You're not wrong, but I wouldn't separate the two. The reason Google can have the #1 advertising platform is because it runs the #1 search engine. Search powers personalized advertisements, and is responsible for most of the money in Google's business.
The money comes from advertising that is placed on searches.
And on websites and mobile apps. Search is just a means to advertise at this point, while advertising is the big money maker.