the pilots need to fly <N> hours to keep their pilot rating anyways.

So aside from the slightly elevated risk to the civilian observers, and the occasional risk due to maneuvers (I think they doing something particularly showy in this case?), the extra cost to the taxpayer do this is ~nil.

What sort of hours do you log for a crash? Does it end when the ejection starts, or feet-on/the/ground?

if the pilot doesn't have their hands on the stick flying the plane, i don't think those hours (... less than single digit minutes?) count.

When the plane comes to rest on the ground.

...or perhaps the last piece of it.

[deleted]

There are two expensive holes in the ground that do not support your supposition.

Only if there's a significant difference in risk between training flight and air show flight.

Otherwise there's always a near constant ever present risk of uncontrolled unintended landings with expensive repair and replacement costs.

That’s a pretty big “only”.

Airplanes normally don’t fly so close.

There are many situations in real combat where pilots need to fly even closer than typical air show formations, like refueling or escorting other aircraft. So close formation flying is a fundamental skill for a pilot. Sure, we can minimize risk by not using certain aircraft and close formations during airshows, but pilots will still need to train and execute missions using high(er) risk maneuvers. Also air shows are probably not the largest portion of flight time for a pilot.

Formation flying usually involves getting close and then 'just' maintaining distance. This has nothing to do with formation flying, this is acrobatics, different ballgame

Fighter jets in training probably do?

Doubtful there is any acrobatic training like this for the regular fighter pilot.