If you make a sell order for 10BTC plus fees but you only have 9.99BTC, your order is split into two parts, one at 9.99 BTC minus fees, the remainder being some small fraction of a bitcoin. You can then quickly cancel the large part and the second becomes valid.