A wager on a horse race is very different than many other forms of gambling. Horse racing payoffs are calculated on a "pari-mutuel" basis. Basically, this means the house (the racetrack) does not particularly care who wins a given race. The odds on each horse to win are determined by what proportion of the total money wagered is placed on that horse.
The "favorite," or the horse with the most money wagered on him to win by the public, will have the lowest odds. The "longshots" have the least amount of money wagered on them and therefore have the highest odds.
The racetrack handles the money, keeps a commission, and calculates a given horse's odds based on the public's preferences. The remaining money is then paid back to the players who hold winning tickets. To the racetrack, the result of a given race is usually insignificant. To the wagering public, however, it means everything!