At scale, ads do something, but what it is isn't very clear. Some people are convinced that ads do real harm but the evidence seems fairly shaky. There are lots of dodgy psychological theories out there.
Here's one dodgy theory (with little evidence behind it) about how ads might work:
https://meltingasphalt.com/ads-dont-work-that-way/
Also, how they work in general is different from whether they work in me. I think observing my own thoughts processes and behavior is better evidence than someone on the Internet telling me what they believe about ads.