Ukraine is selling its wheat to pay for weapons.
It's hard to find anything definitive on the subject, but that aligns with my understanding. Countries like Poland ship them obsolete Soviet equipment, and the rest of the NATO countries ship them NATO weaponry which is either obsolete, or approaching or past its expiration date. In exchange, Ukraine has to pay them with money from current sales of grain.
The NATO countries want to keep the war going as long as Ukraine still has anything of value they can extract to line their own pockets. The NATO countries are able to replenish their military stockpiles with new weapons with the proceeds, or at least what remains of it after the graft.