What companies are known for and what puts them in the headlines isn't necessarily how those companies generate the bulk of their profits. Many of us would be surprised to know what's really fueling the bottom lines of well-known companies we think we understand.

That's why it's worth taking a closer look at some of the most popular stocks in the retail and technology industries -- including Amazon (AMZN 2.29%), Costco (COST -0.09%), and Alphabet (GOOG 0.56%) (GOOGL 0.66%) -- to see how they actually generate their cash.

Woman holding money and smiling.

Image source: Getty Images.

Amazon's web hosting services are the company's golden goose

Amazon is, of course, the e-commerce behemoth whose online sales account for about half of all online retail sales in the U.S. The company made $141 billion in revenue from its retail sales in the U.S. in 2018, and the segment generated $7 billion in operating income.

Amazon has built out its e-commerce strength with its Prime memberships -- which now top more than 100 million in the U.S. -- and those subscriptions keep users closely tied into the company's ecosystem. Amazon Prime members spend $1,400 on the company's e-commerce site each year, compared the $600 per year that non-Prime Amazon users spend.

But despite all of this, Amazon generates just a fraction of its net earnings from e-commerce. Instead, Amazon's bread and butter is its cloud computing segment, Amazon Web Services (AWS). AWS had sales of just $26 billion in 2018 but generated more than $7 billion in operating income. AWS allows companies and developers of all shapes and sizes to host their content online and tap into powerful cloud-based services like image recognition and text translation.

What's great about Amazon earning most of its profit from AWS is the fact that the cloud computing market will be worth $278.3 billion by 2021 -- up from $175.8 billion in 2018 -- and that Amazon is the undisputed leader in this space right now with 32% market share.

Costco's memberships are the company's secret sauce

As one of the most well-known buy-in-bulk membership club stores, Costco hardly needs an introduction. The company has more than 770 stores across the globe, and comparable-store sales in the most recent quarter were up 7% in the U.S., sequentially. Sales from its stores generated a whopping $138 billion last year.

So how much profit did Costco make from all of that retailing? Virtually none.

Between the cost of buying the goods it sells at a discount and the company's additional costs to run its business, Costco's discount retail business actually costs the company more money than it makes.

But Costco isn't worried, because its real moneymaker is its memberships. The fees the company charges people to be able to shop in its stores are what fuels its business -- and business is good. At the end of 2018, Costco had 51,600 members, up from 49,400 the year before, who generated $3.1 billion in paid fees.

And while it might seem risky for Costco to base its bottom line on memberships, investors should consider that the company has a membership renewal rate of 90%. Even as Costco raised its membership fees last year, it still managed to hold on to the vast majority of its members. All of which means its customers are very satisfied with the deals they're getting from the store -- and that Costco's profit maker is firmly intact.

Alphabet's advertising business is what keeps the lights on

Alphabet, the parent company of Google, has its hands in everything from driverless cars to its Android mobile operating system. And Google, of course, serves up the most relevant online search results for its users and provides online-based data storage, email, and cloud-based software through its G Suite products.

If all of that weren't enough, Google is the third-largest cloud computing provider, behind Amazon and Microsoft, and has the second-largest mobile app store after Apple's App Store. So which one of these businesses is boosting Alphabet's bottom line?

None. That's because, despite all of its moonshot projects and headline-grabbing devices and services, Alphabet is actually an advertising company.

Last year, the company made $137 billion in revenue, and more than $30.1 billion of that trickled down to the company's bottom line. The vast majority of those earnings came from serving users display ads in search results, Gmail, YouTube, and the company's other services.

eMarketer estimates that Google held 37% display advertising market share in the U.S. last year, with Facebook being its closest competitor with 20% of the market. Alphabet is likely to hold onto this dominance considering that it has 90% market share in the search engine market, and eMarketer estimates that Google will hold onto 35% of display advertising in the U.S. through 2020.

Keep an eye on these companies for any changes

While these companies may be making their profits in unexpected ways, investors should also be interested in them because of how they're dominating their respective markets. And, at least in the case of Alphabet and Amazon, these companies have their hands in so many different businesses that it's very likely they can adapt and change their income strategy as needed.

Alphabet has indicated that it wants to start generating more profit from its cloud computing business, and Amazon has already begun making more sales from advertising. All of which means that investors should continue keeping a close eye on how these companies are evolving.