It’s not for nothing that Facebook wanted so much, mobile phone numbers associated with private WiFi networks that you have a good localization with
To get this information, they don’t need WhatsApp at all. Then the Facebook app itself will be enough for them.
Usually, the Facebook app has access to your contact list. There you can see who the current phone number is. As for. The Facebook app knows the user’s phone number. (This or through a “Facebook friend” who has your phone number in their contact list).
Then it is visible to the apps they connect to WiFi. The Facebook app can also access your location, so they have created a geodatabase of known access points. (Which is relatively consistent in practice, as the majority of people don’t have a different access point each month.)
The above also works if anyone in your circle of acquaintances has the Facebook app on their phone and has access to your WiFi, or if the device they’re using is allowed to scan WiFi itself, given the popularity of Facebook, or the amount of phones it’s installed on ( whether out of factory or not) as standard.