I've seen it happen (Phase 3: fired), though fortunately not to me.
- company scrambles to come up with a good counteroffer, with more money and a transfer onto a more exciting project.
- company decides it needs to lay people off
- "more exiting project" manager sees some new guy on his roster, making more than everybody else. Seems like a safe choice for the axe.
So in a few months, you can go from having two really good offers to being on unemployment and having your best possible alternative being a company that you've left hanging.
The rule in situations like this is to always go to the new company. You can play offers off each other if you like, but the risk of staying put is just not worth it.