Meaning of “how/what/why, etc on earth?” - Learner’s Dictionary

how/what/why, etc on earth?

informal

used when you are extremely surprised, confused, or angry about something:

Why on earth didn't you tell me before?

(Definition of “how/what/why, etc on earth?” from the Cambridge Learner’s Dictionary © Cambridge University Press)