If you fall behind on your mortgage payments, and don't come to some sort of resolution with your lender, you're going to end up in foreclosure. The end result of foreclosure is often a public auction.
The foreclosing party is obligated to publicize the auction in advance in local newspapers and online. On the day of the auction, the property will be sold to the highest bidder. That's the goal, anyway. But sometimes there aren't any buyers at the auction willing to pay the minimum price that's been set.
When that happens, the lender will usually take the home back. According to RealtyTrac, in 2016 71.5% of completed auctions in the U.S. resulted in homes going back to the foreclosing lender, and the remaining 28.5% went to a third-party buyer.