Not by accident. By the immense sacrifice of the Ukrainian people and it's armed forces coupled with US goals just happening to align on Iran. I somehow doubt the Ukrainians mind very much that shahed production is now pivoted towards targets closer to Iran than to Ukraine.
I mean Trump didn't intend to help. But somehow NATO is in a better state and Ukraine is winning. Its only in the largely imaginary political narrative where NATO is somehow weaker. What is weaker is the credibility of several European leaders. And nobody here thinks that this was some master plan or 10D chess by Trump.