When the dealer stops taking any more playing cards, each of the hands is compared to the dealer's. If your total is closer to 21 than the dealer's, you win that hand.
If the value of the hand is 22 or more, then it is "burnt" and losing. If the value is the same as the dealer's (you both have "Blackjack"), it is a tie and bets will be returned.
If you have hedged your bets, you will limit your losses if the dealer makes a Blackjack (total of 21 from the first 2 playing cards).