It's been written about often. Trumps win some number of delegates during a primary vote, then a state convention is held in some states to actually elect all the delegates won by whatever candidates.
Cruz supporters come into the state convention and find Double Agent delegates to help elect as Trump delegates, DAs who will not be loyal to Trump beyond the first ballot. They do this with the help a many anti-Trump state and local Republicans.
How much do you want to read. The first article (SC) at the top of the page tells what's going on.
-- How much do you want to read. --
Not any more on this subject, beyond what I bump into in other research, thanks.