A bad beat is when you lose a bet after it all but looked like a guaranteed winner.
A bad beat comes in a wide range of forms. One of the more popular ones was Super Bowl 51 when the Falcons lost a 28-3 lead to the Patriots to end up losing 34-28. It was made worse for whoever backed the Falcons spread (+3) after the Patriots added a touchdown in overtime to cover as -3 point favorites.
Bad beats are common in college basketball because of the amount of games, enhancing the likelihood someone hits a last-second shot. If you bet during March Madness, you'll likely be part of a bad beat at some point.
Bad beats also extend outside of sports like at the 2017 Oscars when La La Land was announced as the Best Picture, to only have Moonlight secure the win because of confusion that came about after presenters read the wrong movie in the winning envelope.
Needless to say, you don't want to be part of a bad beat.