Maybe you saw a deal that was so good you could not pass it up. Maybe you had your eye on a house and you jumped on it when it finally hit the market.
Either way, you decided to buy a new home before you had actually sold the one you already owned. However, you wanted to protect yourself so that you would not be stuck with two homes, which you may not have been able to afford.
In a situation like this, you may want to use a contingency in the contract, stating that you can walk away from the deal if you are not able to sell your current house. You're not obligated to buy the new one, even if you made an offer and they accepted it. When your house sells, you can move forward, but you won't be stuck with two mortgage payments at the same time.
There are a lot of advantages to doing this, and not all of them are financial. This also makes it easier to move your family since selling before you buy can leave you in limbo if you don't find a house you like.
That said, it is very important to know exactly how these contingencies work. They can massively change real estate contracts and give you far more control, but they can also lead to disputes -- especially if you do decide to walk away from the deal and the seller says you are obligated to buy the home for some reason. When a dispute arises in a real estate transaction for any reason, make sure you know all the legal steps you need to take to protect yourself.