In the US, you get yourself a buyers agent, see a house, make an offer, and it's accepted after a bit of negotiating. You deposit your earnest money with the seller's agent in an escrow account.
Once the offer is accepted, or even before, you get a lawyer as well as the buyers agent .
The agreed price is part of the contract. The contract usually includes stipulations that the buyers will have a survey done, their mortgage lender will do an appraisal, and they will secure a mortgage for 80-90% of the agreed price, that the buyers will have a home inspection by a licensed home inspector, and that they can pull out if they can't get a mortgage for the percentage of the agreed price or if the home inspection reveals anything they're not happy with. Buyers can pull out if the title to the property is clouded too. A title search is done as part of the process.
There are dates by which all of the above have to be accomplished. The agents can negotiate extensions if needed, but they are rarely more than a short period.
Sometimes, the parties will renegotiate the price if the inspection reveals that costly structural repairs are needed or if the mechanicals need replacing (HVAC, plumbing, any appliances that are going with the house). This depends on how motivated the seller is. Sometimes a seller will offer appliance or HVAC insurance in lieu of a price drop.
The important thing is that the various deadlines by which the different elements of the sale/purchase are accomplished are set forth in the contract and must be adhered to. Parties can't pull out or entertain other offers while under contract except for reasons related to financing or the home inspection (or death, disability, or posting out of the area on the part of the buyer, or death or huge change of circumstances for the seller, or full or partial destruction of the property by any means - this sort of detail is all in the contract boilerplate). Some places include ability to secure insurance or flood insurance as part of the contract. The mortgage company will not issue a mortgage without insurance.
So there's no gazumping, and at closing, there is no gazundering. Closing is usually straightforward and involves lots of signing of documents and the handing over of the keys. Possession is guaranteed immediately for the buyers.