Good question, notice that but never think of it.
My guess would be something to do with water pump operate (turn on engine) or not (turn off engine). Just my wild guess. Becuase in my Mini, the water pump will suck water from radiator, which should create low pressure and suck water in from expansion tank when engine is operate. (water from radiator is in low pressure side of the pump) If you run engine very hard, I would guess that water temp will be higher than normal and expand? So when you turn off the engine, the pressure of system normalise and become higher than the regulate pressure at the radiator cap, which is why it overflow the expansion tank?
Could it be that your radiator cap is knackered?