If I could only buy one stock, it would have to be from a stable company with a durable competitive advantage and strong, consistent cash flow. Maybe more importantly, I would want to get the stock at a good value to reduce any potential downside risk. 

The company that fits that profile to a "T" is Apple (AAPL -0.57%). It may not seem like a company with a nearly-$1 trillion valuation has much upside left for investors, but Apple is built to churn out cash and dominate the tech landscape for years to come. 

Apple store at Apple's Visitor Center.

Image source: Apple.

Apple's tech dominance

Before getting to Apple's amazing cash flow, I think it's important to understand how Apple has been able to build such a valuable business. Apple's success starts with the iPhone, which accounted for 62% of the company's $61.1 billion in revenue in the first quarter of 2018. The iPhone is able to command a premium price from consumers, driving a gross margin of 38.3% last quarter.

The iPhone's popularity creates a durable advantage for Apple in a couple of ways. First, the ecosystem of apps, cloud services, and subscriptions make it highly likely customers will stay in the iPhone family long-term, upgrading to a new model every few years. Switching to a new phone manufacturer isn't impossible, but it's not trivial, and customers have proven that once they own an iPhone they're likely to stay with an iPhone. 

Beyond the iPhone, Apple uses its home-grown operating systems to make it easy to add other products. The iPad, Mac, Apple TV, and Apple Watch all work seamlessly with the iPhone, and purchases work across the whole product line. Once customers start purchasing Apple products to go with their iPhone they can get pulled deeper and deeper into the ecosystem, and that's when switching costs to move away from Apple become extremely high. 

With millions of consumers using Apple devices, the company is also able to attract developers to create content for its devices. More customers means more developers, which ultimately serves as a way to lock out competing operating systems. At this point, Apple and Alphabet's Android operating system together have 99% market share for mobile operating systems according to research firm Gartner, and it's unlikely anyone will challenge that dominance in smartphones in the foreseeable future. That's what I call dominance in tech.

Apple's cash machine

The iPhone's dominant position in smartphones and the growing ecosystem of products around the iPhone have created a cash flow machine for Apple. You can see below that net income and free cash flow are now about $50 billion per year, and essentially all of the cash generated is being used to pay dividends or buy back stock. 

AAPL Net Income (TTM) Chart

AAPL Net Income (TTM) data by YCharts

The fact that Apple is returning excess cash to shareholders is a big reason I think the stock is a great buy. The company continues to increase its payout to shareholders, reducing shares outstanding along the way. Despite all of the cash outflows, net cash on the balance sheet is still $165.9 billion, a huge cushion if Apple runs into competitive challenges long-term. 

A tech company built to last

Apple is so much more than just an iPhone. It's a company hundreds of millions of people rely upon to cummunicate with others and stay connected to the world. The ecosystem of products will continue to keep customers coming back, and as long as we use smartphones I think Apple will be one of the biggest and most profitable companies in the world. That's why it's the one stock I would buy today.