What happens to the difference in compatible buy and sell orders on bitcoin exchanges? Let's say Alice is selling 1 BTC for $10,000. Soon after Alice makes her sell order, Bob places a buy order for 1 BTC for $10,010. These two orders are compatible, since Alice would gladly take an extra $10.

My question is, what happens to that $10. 


Does Alice receive $10,010 even though her sell order was only for $10,000?
Does Bob only have to pay $10,000?
Maybe they split it down the middle, Bob only has to pay $10,005 and Alice receives the same?
Does the exchange just keep the difference? Is this how (in addition to the fees) exchanges profit?
To answer you:


  Does Alice receive $10,010 even though her sell order was only for
  $10,000?


No, Alice will receive $10,000 only


  Does Bob only have to pay $10,000?


Yes 


  Maybe they split it down the middle, Bob only has to pay $10,005 and
  Alice receives the same?


No, that is not how an exchange works. The largest bid get's filled first. And the smallest sell order get's filled first. 


  Does the exchange just keep the difference? Is this how (in addition
  to the fees) exchanges profit?


No, the exchange is only entitled to get fees for the transaction unless specified otherwise.