Well, one such source of email addresses was me.
When I joined it more than 10 years ago, I was not as privacy aware as I am today. So, upon joining, I uploaded my address book to connect to people who already had a LinkedIn account.
I shortly after realized that they abused it. They sent an invite email to every person that was not on their platform.
I only got to know about it becasue one of my university professors sent me an email saying that she was not interested in joining yet another network. I had to apologize, because I did not expect that to happen.
To this day, LinkedIn still uses that information to suggest new connections to me and to prompt me to invite people that are still not on their platform.
In retrospect, it was a stupid move to upload my address book, but I'm sure I am not the only one that made that mistake, and probably many people still do nowadays.