How's this allowed by Facebook concerning WhatsApp? It's usually a very closed system. How does the bridge work in this case?

It likely uses this Matrix bridge: https://github.com/mautrix/whatsapp