“How exactly does Ukraine joining NATO threaten the existence of Russia?”
Because it borders Russia. And Putin and the Russians are the ones to consider when they think they are being threatened.
Half a dozen NATO countries already border Russia - Norway, Finland, Poland, Estonia, Latvia, Lithuwania, and the USA has a maritime border in the Bering Sea so Ukraine as an existential threat is nonsense. A NATO attack if one were ever to come would likely first target St Petersburg which is Russia’s second largest city, former capitol and just a few short miles from NATO territory or even more likely the exclave of Kaliningrad.
No the Ukraine war is about revanchist ambitions and nothing more. Putin wants to regain former imperial and Soviet terriitories lost when the Soviet Union collapsed.His ambitions far exceed his means and are bringing ruin to his country.