For many sites, such as Facebook and Google, a big part of their business plan is based on tracking your interests so they can target you more effectively with their ads. Think about it. Just look at the ads on your pages. Does it seem to you that they reflect things you've searched for, said, or liked? Of course they do.
Besides, these days, Facebook relies on Facebook Login, a kind of single sign-on (SSO) to keep track of you when you're away from its site. This way, whenever you use Facebook to log in to some other site, say Pinterest, Facebook knows where you are.
It's not just Facebook. Google has its Advertising ID to track Android users, and Apple uses your email address and IDFA (Identifier for Advertisers) to keep an eye on you. With the rise of big data programs, such as Facebook's Atlas, it has become easier than ever for companies to monitor your every internet move.
What we've done is trade our personal information for convenience. We get what we want from the web quickly, and in return the companies we deal with and their advertisers get to follow us every step of the way.