Facebook makes the data available to advertisers who are then responsible for targeting you well based on that data. If the advertiser makes terrible targeting decisions but offers a high bid for a click, then despite your low CTR and low conversion rate, you'll see the ad. Facebook is not choosing which ads you see. (The recommendations, sure.)
I think the technical term for these ads that stalk you after you have bought the product is 'remarketing'.
Amazon should know what they are doing but they do the ads of what you have just bought, even though they have good information. No idea what their excuse is for fluffing it.
However, with small companies, e.g. a clothes shop, they don't do the website necessarily themselves, getting an agency to do it. When they get to a certain size they bring this work on house, but the principles of cock up are the same, in the agency or in house.
The agency doing the website have extra add on services for SEO, remarketing and other marketing snake oil. The people in these jobs are not the sort that can do database joins. They use products that have been marketed at them and generally work on second hand hearsay to determine what works, even though they do use graphs and data.
They are not necessarily going to know the products and even though they buy adverts they do not see themselves as in the advertising game, more in the marketing field.
The internet has raised everyone's boats over the last few years so these people can have some legit upward pointing graphs, what is less clear is whether it is demand, price or product that has got their clients online sales up. However, they can claim it is all their work and that the campaigns they have put on have changed something assumed to be static.
On this snake oil they can attract new clients to bring them marketing spend. They try their hardest but they are not data power users. I know that is tarring a whole industry with the same brush, but the people in this industry will be 'power Excel users' rather think to become 'novice SQL users'.
To be honest logging in to some of these Facebook account screens is quite hard work, going through the right channels to get the login details from the client can take all day. Uploading data probably needs help from a developer on a different team, plus you have to go home at 5.30 on the dot.
People that are good at selling product believe in customer service, word of mouth, product and a multitude of things that are a million miles away from remarketing. So the industry of online ad sales invariably has hit and miss results because the people in the business are unlikely to be that smart.