Google won the search engine market because it was objectively better and thus spread through word of mouth. The first time I saw Google run actual ads was when they pushed Chrome hard.
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.)
You just described two companies that became the ad channels, so they certainly are a bit of an exception. Even Apple, who has the most word-of-mouth viral product line in all history, used advertisements from the beginning.
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.)