On the one hand, it can be exchanged for other people who need dollars.
On the other hand, it can be used for the allocation of foreign assets.
The former earns exchange commission. The latter is an investment.
As for the foreign banks you mentioned, there should be no contact.
Now the foreign exchange market is very developed. If banks don't want dollars, just throw them out.