Or why doesn't one of the marketed brands stop the advertising? If it doesn't affect sales, it's a useless expense, and any profit maximizing entity would cut it.
To me, the obvious answer is that advertising does work. Without it people don't by your product that much, and you get replaced on the store shelves by brands that produce sales.
Also note that the store brands are being advertised when the store markets itself. They're not unadvertised.
Facebook also spread mostly through word of mouth and only started doing ads when its public image deteriorated.
(Side-note: I'm in Germany, so this is about German ad campaigns. Also I have had adblockers for a long time, so when I say "they run ads", I mostly mean TV, print and billboards.)
Then again, when I google tom's of maine advertising, I get many hits saying the opposite, like
https://www.youtube.com/channel/UCcfhusG_iJcQyFSBEOyeucA
I didn't check the other brands
I doubt it's financially feasible to advertise on TV for the sales they expect in their niche. I'm not sure if it's the best way to reach people interested in natural toothpaste. I don't know whether consumers would think they stand out for not advertising, but it's possible that some customers prefer a a less known brand for some sort of feeling of exclusivity.
On this subject, though, there is more at play than just advertising. First is availability; smaller stores won't have a private label option available at all, so some chink of the market is not open to them.
Second is quality; this is not as much an issue with OTC pharmaceuticals since it's all about the active ingredient, but for products where more than just the active ingredient matters (like flavor or consistency) there is sometimes a quality difference. There definitely is with food.
That said, I frequently buy store brands over name brands. I also buy some "name brands" that I have never seen an advertisement for.