Android makes a ton of money for Google because for every Android phone, that's one more user they don't have to pay to have their default search engine be google.
Take a look at the Oracle case - Google pays billions of dollars a year to Apple to have their search on iPhones. And it's not a flat fee, it's a percentage of revenue.
Facebook doesn't have this problem because there is no other social network. Search engines don't really have network effects, facebook does.