It's a simple mathematical equation. All casinos or professional gambling establishments that allow betting on events use similar equations. You make the pay out for the most popular bet smaller than the pay out for the most unpopular bet. As the bets progress, the odds change to make sure that you have enough money from one side of the bet to payout to the other side of the bet (as well as keep a percentage).
For example, most people would bet on Team Europe if the payout was 1:1 (You bet $1, you win $1 if Team Europe wins). If the payout for Team Europe was 3:1 (You bet $3, you win $1 if Team Europe wins) and the payout for Team USA was 1:1, more people would be willing to bet on Team USA.
Using an equation and factoring which bets have been placed, the payout or spread is modified to keep even money on both sides of the bet so that the losers' money pays the winners after the house's percentage is taken out.