Advertisers would compete within that search engine to have the most relevant and accurate product and service offerings to match demand, and would pay the search engine provider for the hosting.
The search engine provider could attribute and send credit back to the websites from which advertising requests from the user agent originated. This could be attributed based on requests, clicks, purchases, etc.
Under this model, publisher websites would not need to design and manage their pages specifically to incorporate advertising slots, and users would not have to see any advertising at all unless they are genuinely interested in further commercial information related to the page they're on.
As a side-effect this could reduce the usage of advertising in various grey areas (spam, disinformation, and even the rare-but-feasible harassment of individuals by using targeted advertising).