A reasonable question for a non-gearhead; I'm happy to explain!
The function of a head gasket is to seal the cylinder head (think of where the valves and spark plugs live) to the much larger engine block (think of where the pistons live, moving around inside the cylinders.) Modern head gaskets are typically steel, and in fact are usually multiple layers of sandwiched steel - referred to as an MLS gasket. Compare this to old-time head gaskets, which were usually a fiber of some sort, with perhaps a thin steel or copper sealing ring just surrounding the cylinder wall mating surfaces.
Engines run by very tightly compressing air and fuel together, igniting it, and converting the expanding burning gasses into mechanical leverage to turn the crankshaft. There can be thousands of pounds of pressure per square inch inside each cylinder when the engine is at full throttle. As you might imagine, the cylinder head bolts which serve to hold the cylinder head and block together, with the head gasket in the middle, must withstand incredible force to keep everything together.
When you hear about a blown head gasket on a modern engine, it is near-always not a failure of the gasket but instead a failure of the head bolts (irregular clamping pressure allowing a leak) or a failure of the block or cylinder sleeves. In a scant few rare cases, it can be a failure of the compressed fire ring in the gasket usually as a function of a design flaw (the 2.3L Ford Ecoboost engines in the Mustang and Focus RS were an example of this.)
No matter the cause of the blown head gasket, the resulting damage always requires both the cylinder head and the engine block to be machined back to perfectly smooth, flat and square again. Failure to do this right will near-certainly guarantee another failure of the head gasket in the future.
It's also worth noting that both coolant and oil pass thru this gasket in multiple places. If a head gasket has leaked for a while undetected, it may have permitted oil and water/coolant to mix, which may have caused damage to oiled bearings elsewhere in the engine, particularly in the big load-bearing rotating components like crank mains and big-end rod bearings. This can also lead to premature failure of bearing surfaces, which ends up causing the engine to grind itself to seizure and death.
If it has taken a mechanic nine months to figure out a head gasket failure, you should be entirely suspicious of the engine's remaining life.