I have friends at Google, and have heard nothing indicating that salaries are anywhere in this ballpark. I also just spoke to someone whose girlfriend works there, and he too agreed that this article is bullshit. They might mean mid-level manager, or they may be counting all of the perks as part of the salary. But even there, a half-million retention bonus seems absurd to both of us.
Could "Mid-level developer" might mean a super developer who's considered at the level of a mid-level manager? IE, mid-level != mid-range?
Google is a lot bigger than Facebook currently so I'd assume Facebook would be aiming to pick what they consider the "cream". The article mentions 118. Google has ~20K employees and a good portion of them would engineers.
In any corporation of that size, there are some "mid-level developer"s who are far better at what they do than their title suggests. For whatever reason, they just haven't moved up in title as fast as they've moved up in skill or productivity.