From the Wiki:
Masternode payments in Divi are determined using a decentralized random selection algorithm based on masternode tier. Every masternode appears in the global list. Once a masternode is active for some amount of time, it’s eligible for payments. Once eligible, it takes part in a probabilistic process that determines the winner for the next block. Different tiers have different chances to win.
When a new block is added to the network, every masternode submits a vote for the winner, which appears in 10 blocks in future. Voting is a probabilistic process of selecting masternode winner.
Score is a double SHA256 of the funding transaction hash and ticket index for all masternodes in the selection pool. The score is compared with the block hash 100 blocks ago. The masternode with the closest numeric hash value to that block hash receives the payment.
Ticket is a number that represents one try to create a score.
Whoever gets the maximum hash wins the selection process. Each masternode tries to produce a maximum allowed score (hash) based on their masternode tier. In practice it means that it tries several times to hash to maximize the chances of winning.
We build a pool of tickets for every masternode and select masternode with closest numeric hash value to block hash.