I don't know the exact logistics of it, but basically it was an order placed and paid for by the Berlin police, the masks were coming from China and should had been placed on a German bound cargo plane in Bangkok. Instead it was "seized" and diverted to the US instead. Probably bribed some Thai authorities to get it done, they are quite close with the Americans. Berlin police as well as German politicians including the minister of health alrady confrmed that, but apparently the amount of masks was mis-reported. It should be 200000 instead of 600000. France accussed the US of doing the same to their order too.
https://www.n-tv.de/politik/USA-fangen-von-Berlin-bestellte-Schutzmasken-ab-article21691173.html