Exchanges work by pairing people on the opposite sides of a trade. If you want to exchange your dollars to buy some XLM, the exchange will match your bid with someone who wants to exchange their XLM for dollars. The exchange will keep a small fee for facilitating the trade.