How it works
You submit the order with no price condition. The exchange matches it against the best available counter-orders in the book, walking through price levels until the full quantity fills. The fill happens within milliseconds on liquid instruments. On illiquid ones, the order may consume multiple price levels and leave you with a worse average price than you saw on screen.
Example
EUR/USD ask is 1.0856 with 5 million euros available at that level. You submit a market buy for 1 million. You fill at 1.0856 for the full amount, no slippage. Now submit a market buy for 20 million on the same book. You take all 5 million at 1.0856, then 8 million at 1.0857, then 7 million at 1.0858. Average fill: about 1.08571. Same intent, very different outcome.
Why it matters
Market orders are right when execution speed matters more than the exact entry price: news-driven entries, exit on a stop, hedge against a fast move. They are wrong when liquidity is thin or you have time to wait: large position sizes, illiquid pairs or hours, intent to add to a position at a level. Match the order type to the context, not to habit.