That’s just a tiny tiny part of it.
And on the other end are the actual ads, which are part of marketing campaigns. Where each campaign can define a specific target demographic (doesn’t have to, but usually they do as it’s just wasting money otherwise).
So for makeup the ad might target white single women in the age of 16 to 45 who live in better income areas for example.
I bet you have a hundred conversations with your friends where you didn’t receive a fitting ad afterwards.
The secret is a bidet. Much cleaner and suddenly I spend a third on toilet paper compared to before (you still use some for drying and checking).