The bet is for whatever it gets called for. If I have 10,000 and go all-in and you call me with 5,000, you’re all-in and I get 5,000 chips back IF no one else with more chips than you also goes all-in. Now, if another player calls and goes all-in after you, with say 8,000 chips, there is now what is now known as a side-pot. So here’s the breakdown:
You, me, and third player all playing together for a pot of 15,000 chips. This is the main pot.
The third player and I are also playing for a pot of 6,000 chips. This is the side pot.
So, the most you can win is 15,000. The most the other guy can win is 21,000. The most I can win is also 21,000. However, I had both bets covered. So, if I lose both pots, I’m still alive with 2,000 in chips.
Note, however, that it is possible to win a sidepot and lose the main. Say I have a pretty good hand, two pair, and good enough to win the side pot. I could still lose to you if you had a better hand. So then I’ve won 6,000 from the side pot and lost 5,000 from the main pot, for a total win of 1,000. I’m now up to 11,000. You won the main pot and tripled up to 15,000. And now the third guy is busted. Same is true for the other guy, except, as before, I wouldn’t bust, I’d be down to 2,000.