In the period from 2010 until 2017, Facebook had agreements with large (Tech) companies to share all users data. This gave them the ability to harvest personal data, without your consent.
Facebook began partnerships for its own benefit. They did not sell data, but gave other companies access to user data. In return, the partner drove more traffic to Facebook and supporting Facebooks growth in ad revenue.
The New York Times wrote a comprehensive article after obtaining hunderds of pages documenting this. To confirm, they conducted more than 50 interviews.