Where do all the obsolete weapons go?

I’ve often wondered where some of the poorest people in the world get their weapons/ammunition from. I constantly see that they seem to get great pleasure from firing into the air rounds from automatic weapons.
Firing 100 to 1000 per min? at $1 to $2 each?
How do they pay for them?
Then I saw the delivery of obsolete Australian tanks to the Ukraine.
Never a shot fired in anger but out of date/obsolete, scrap value to some.
What a great business model! Even better when you’ve got the president of the US spruking for you.