For more than two decades, Jeff Bezos has famously sacrificed profit for growth, persuading Wall Street that Amazon.com Inc. was best served pouring money into the logistical nuts and bolts that have turned his company into the Wal-Mart of the web. More recently, investors have found solace in the company’s profitable cloud services business, which has helped offset losses in e-commerce. Still, for the past five years Amazon’s average profit margins have languished at about 1 percent.

Now along comes a business that could generate consistent and healthy returns: It’s called advertising. Over the past several years, Bezos & Co. have quietly put together the pieces for a marketing platform that lets Amazon make money from the sheer size of its audience.

Having bet on Amazon cloud services and pushed the shares past $1,300, investors are now salivating about the ad business, which doesn’t require big investments in new data centers or shipping hubs and generates fat margins. On Monday, BMO Capital Markets upped its Amazon price target to $1,600 a share, based largely on the growth of the ad business. Some analysts are predicting Amazon will reach $2,000, making it the first company with a $1 trillion market value.

“Advertising is the most profitable business in the world,” says Jay Kahn, a partner at Light Street Capital, who notes that Chinese e-commerce giant Alibaba Group Holding Ltd. gets more than half its revenue from ads. “For Amazon, advertising is going to be more profitable than its cloud business.”

On Thursday Amazon once again reminded the world of its growing dominance, revealing a shortlist of North American cities vying to host the company’s second headquarters.

For years, Amazon kept advertising on the site subtle for fear of alienating shoppers who had become used to choosing what to buy based largely on customer reviews and price. Amazon has been slowly giving more prominent placement to sponsored products in search results, forcing brands to buy ads to win top billing. It’s easy to see why. By 2021, advertising on websites and mobile devices will account for half of all ad spending in the U.S., capturing greater share than television, radio, newspapers and billboards combined, according to EMarketer Inc.

So far, that shift that has mostly benefited Google and Facebook. By contrast, Amazon has a tiny advertising business that last year generated $1.7 billion in revenue, according to EMarketer, compared with Google’s $35 billion and Facebook’s $17.4 billion. But it’s growing quickly because companies like Procter & Gamble and Mondelez see Amazon as the place to win the “digital shelf” in the same way they fought to win the physical shelf in supermarkets.

Amazon has an advertising platform no other company can match: a web store selling hundreds of millions of products combined with a streaming entertainment service and a trove of data about customer preferences. Amazon attracts 180 million…