The head gasket keeps the pressure from the spark plug's ignition of fuel vapors inside the combustion chamber. It also ensures that the chambers for oil and coolant remain separate so that they can each do their jobs without creating any unwanted mixing.