Col, I might have a different take on this that will help you understand.
Politics is a big gamble in that the politicians each hope to gain their office and through that office, gain a lot of personal influence. But they need the money to get their name out there. So you ask the perfectly legit question, "What's in it for the donor?"
The answer is "predictability." One of the slickest politicians ever to come out of Louisiana was Edwin W Edwards, who once offered the definition of an "honest politician." He said, "An honest politician is one who stays bought." I wish to emphasize that while he said it, I do not believe it was original with him. I have found at least nine different usages of that quote with different attributions.
The wealthy donor picks a candidate because s/he believes that the candidate has taken a stance that is favorable to his/her business. Therefore as a gamble, a speculative venture if you prefer, the donor offers money to help the candidate get elected. The candidates "roll the dice" with the voters. Some candidates win. Others lose. The 'honest politician" knows that s/he was elected based on having said certain things during the campaign and those things attracted the donors. So an honest politician holds up his/her end of the bargain and sponsors legislation consistent with that set of campaign promises. I.e. "stays bought."
Now let's do a case in point. Mr. Trump was a believer in the idea that the liberals put too many constraints on business. So one of his platform planks (promises, if you prefer) was to reduce the number of regulatory constraints on business. You can BET that every business person who ever ran into any of the big government regulations would support Mr. Trump. See how that works? And true to his word, Mr. Trump removed a LOT of those constraints, with the concomitant improvement in the USA economy. That increase occurred because the profit margin could be more easily predicted since businesses do not expect Mr. Trump to enact too many regulatory constraints.
Let's do another case in point. It was a poorly concealed fact that Hillary Clinton was being supported by what we call "Big Pharma" - the pharmaceutical industry. I must have read five or six internet articles on the subject. Her promised Medicare expansions would have paved the way for increased payouts for expensive medications AND she would not have done what Mr. Trump did, to work on allowing import of drugs from foreign markets as a type of competition. Hillary would have made it darn near a USA monopoly for USA prescriptions. So Big Pharma stood to gain a huge increase in business and a restricted trade market for pharmaceuticals.
You also asked what happens if the donors guess wrong. Well, at the moment, the Clintons are completely out of power, low profile, off the grid. They have been shunned by a lot of their own party members. She cost the Democratic Party a LOT of political capital as well as monetary-type capital. She was an expensive flop. The Clinton Foundation, a facade for political contributions to be funneled through the Clintons for them to increase their influence, is now out of business because of the incredibly bad repercussions of her flop. In essence she became a bad gamble.