Xenon (Xe), due to its radiogenic isotopes, is a key tracer of atmosphere formation. Indeed, as for other noble gases, Xe is considered inert, volatile, and thus expected to degas upon rock melting and accumulate in the atmosphere. But Xe is atypical. Compared to lighter noble gases, Xe is extremely fractionated both isotopically and elementally. These observations led us to test Xe chemical reactivity at the extreme pressures and temperatures of planetary interiors, and to evidence the retention of its heaviest isotopes in minerals. Unexpectedly, these results have cast light on the very early stages of terrestrial planets, revealing that upon each planetary embryos impacts, magma oceans are formed while atmosphere is massively lost, a scenario repeated about ten times.