The GDP difference is not so big is you consider that they are not fighting Ukraine alone, but also all the countries that believe that they are in the "to be invaded" list [1]. So money/weapons/training flow, but not soldiers. It's good deal for Ukraine because they get money they need for the defense and it's a good deal for the other country because they prefer that the war is fight elsewhere.
[1] And a few more countries with geopolitical motivations.
[1] And a few more countries with geopolitical motivations.