Question: why are nukes detonated in the air?
Answer: In nuclear warfare, air bursts are used against soft targets (i.e. lacking the hardened construction required to survive overpressure from a nuclear explosion) such as cities in countervalue targeting, or airfields, radar systems and mobile ICBMs in counterforce targeting.