> In the latter example, I feel the ad exists entirely to sell something that is completely unneeded rather than to inform about something the person genuinely could find valuable.
Ironically, this is why "targeted ads" are (in theory) beneficial to both sides. Companies certainly would love to sell you their product -- whether you want it or not. But advertisers would rather show ads to people who will want their product (versus those that don't). This is why Instagram is a powerful platform: it knows a lot about you.
The common privacy concern (which is real, but sometimes overstated) is that the more the advertisers know about you, the worse it is. But "Show HN" is kinda the opposite. That's why you like it more.
In any case, I'm not trying to convince you of anything. I personally see ads as a component of commerce. I'm willing to pay to see fewer ads (like Youtube premium) because I value my time. But I accept that websites that earn money from ads deserve to have them seen.