Can someone explain how they _actually_ collect the data?
Which data? These companies track your movement across the internet with cookies. It used to be that a visit to dictionary.com would set over 40 different tracking cookies. I guess with your browsing history and some fancy statistics they can make some pretty good guesses about you.
The WSJ actually has a whole bunch of articles about this stuff. Not sure if I still have the links.