This is the magical thinking explanation. What is much more plausible is that they have such enormous datasets that they are able to train machine learning models to predict interests of people on the basis of any number of online behaviors that they record.
The behavior doesn't even need to "make sense" - it could be that people who log on at these times, live here, travel by train, like dog photos and belong to certain groups are highly to be interested in a particular product. It doesn't matter, the system will learn these relations anyway. It might seem spooky and eavesdropping-y from a naive user's perspective, but the simple fact is that when you have that much data you don't even need to eavesdrop.
The behavior doesn't even need to "make sense" - it could be that people who log on at these times, live here, travel by train, like dog photos and belong to certain groups are highly to be interested in a particular product. It doesn't matter, the system will learn these relations anyway. It might seem spooky and eavesdropping-y from a naive user's perspective, but the simple fact is that when you have that much data you don't even need to eavesdrop.