People don't realize that a huge number of companies (almost all, to some degree?) are doing this sort of thing. My wife and I joke about all the commercials on TV now about "AI / big data / in the cloud" -- in large part because since about 1997 until I retired in 2009 I was doing fundamental commercial work using AI and big data (and most people have no idea how pervasive and capable this sort of software now is). On TV it seems like either marketing hype, some sort of magic, or futuristic science fiction stuff. It's not. There are a LOT of very smart large scale AI applications in the world that no one ever hears about (unless you're in the industry, into the publications, go to the conferences, etc. - and even then a lot of it is proprietary and semi-secret in terms of the details). And they're using their powers for good -- mostly. Sometimes they use their powers to sell stuff. What you're seeing is only a minuscule part of all that.
A big part of this is the price you pay for ease of access and easy browsing and search capabilities. It's a trade-off, and is normally disclosed in part of your registration process (which of course no one actually reads before clicking the "Accept" button). Also, it's a quid pro quo. [Editorial comment: While Facebook is detestable in several ways, to a significant degree the people who use it in the way most do were really asking for something like they got in the recent case. People were surprised? Really? Okay ... done on that.]
One thing you can do if you want to take a programmatic approach is to either disable cookies in your browser(s) (and see how you like THAT result in terms of the "user experience" -- one of those trade-offs) or start tinkering with with your cookies on a domain or site basis. (Some programs/pages can get access to cookies stored by other programs/pages, depending on how things are configured in your browser and what steps you may have taken to prohibit this.) That can be a fun thing to do if you're looking for a way to spend your time or if you want to experiment with various browser features and extensions. For my own part, I'm generally mildly careful with what I put out on the web, and sometimes extremely careful, and otherwise I just use "delete" aggressively, click the "unsubscribe" links (which are usually those microscopic things at the bottom of the email), or occasionally take more specific actions.
I grant you that it's amazing (almost to the point of being laughable when it's not annoying) how much you're unintentionally sharing things through your browser(s). Example: Yesterday for the first time I visited a Honda sight since we recently bought a new Pilot and I wanted to order the full owner's manual. This morning I got a car-related (though not from Honda) advertising email. It's possible that Honda shared the visit information in an automated way with some other companies, but it's also possible that this was just a cookie-mining thing.
Gary Merrill
Wessex EEb Bass tuba (DW 3XL or 2XL)
Mack Brass Compensating Euph (DE N106, Euph J, J9 euph)
Amati Oval Euph (DE 104, Euph J, J6 euph)
1924 Buescher 3-valve Eb tuba (with std US receiver), Kelly 25
Schiller American Heritage 7B clone bass trombone (DE LB K/K10/112/14 Lexan, Brass Ark MV50R)
1947 Olds "Standard" trombone (Olds #3)