There are almost no rare earth minerals in Ukraine. The "desperately going after rare earth minerals" line is something that has appeared in the media...but at no point did they actually check whether Ukraine has any (beyond comical maps that tell you nothing about the grade, recoverability, etc.).
The reason for the deal is: recover money for taxpayers, provide some security guarantee without an explicit commitment that will end up with US being deployed, and backstop significant private-sector investment into Ukraine to try to revive their economy (after the war destroyed and maimed a huge proportion of their working adult population).
My take was the mineral deal was invented by Z (more likely staffers) as a clever ploy designed to appeal to T who is a colossal idiot and can only conceive of geopolitics as consisting of zero sum "deals" that one country makes with another. So they invented a deal. I always assumed it would be a shit deal for T, since idiot and all. But it seems he wanted the shit sandwich for free. Basically negotiated himself into no deal.
No, it was likely invented by people on the US side. Politicians need wins, this is an easy win. It is a perfect deal: the US doesn't really need the money back, and Ukraine doesn't give anything away.
The reason for the deal is: recover money for taxpayers, provide some security guarantee without an explicit commitment that will end up with US being deployed, and backstop significant private-sector investment into Ukraine to try to revive their economy (after the war destroyed and maimed a huge proportion of their working adult population).
There are (almost) no rare earth minerals though.