They dont.
Nowadays it is all about the number of people you have signed up, not always about how much money you make.
Google for example charge you nothing to use gmail or many other Google apps like Google Maps etc, but they make money from all the advertising that is targeted at all the people who use the various google apps.
In fact Facebook paid 19 BILLION DOLLARS for WhatsApp in 2014 which is a ridiculous amount of money to pay for an app that has never made any money.
But WhatsApp has over One and a half BILLION users around the world so Facebook now has access to those one and a half billion people.
Of course Facebook has more money that it knows what to do with so spending that sort of money on a loss making app probably will not hurt them.
Zuckerberg, who runs Facebook, is said to be worth 67 BILLION DOLLARS (probably mostly of it in shares of Facebook) !