When it comes to investing (and nearly everything else in life), there are no sure things. A company can look great on paper and have a seemingly stellar business model but still not deliver the share-price gains investors expect. After all, stocks are vulnerable to the whims of investors, who are prone to being irrational.

But that doesn't mean that all investing is a complete gamble. There are certainly some companies that are in a much better position than others to deliver gains for their investors. To find stocks with the best chance of being great long-term investments, we need to look at three key factors that help determine a company's overall risk: leadership, competition, and financial stability.

With those ideas in mind, let's look at how well Apple (NASDAQ:AAPL) measures up and whether or not the stock looks risky. It's a great time to reevaluate this, considering that Apple stock -- along with many other tech stocks -- has taken a massive hit over the past few months.

Red stock price chart.

Image source: Getty Images.

Apple under Tim Cook

One of the first steps in evaluating a company's risk is to look at how well it is managed. With Apple, there's very little to be worried about.

CEO Tim Cook took over the company on Aug. 24, 2011, shortly before Steve Jobs passed away. Under his leadership, the company has consistently grown sales and earnings. Since Cook took over, the company's annual revenue has increased from $108.2 billion to $265.6 billion, and annual earnings have grown from $25.9 billion in 2011 to $59.5 billion in fiscal 2018. Additionally, Apple's shares have spiked more than 200% under Cook's leadership.

Not only has he created value for the company and its shareholders, but Apple employees also believe in his leadership. According to Glassdoor, which rates CEOs based on anonymous employee surveys, Cook was ranked in the top 100 in 2018, with an approval rating of 91%.

The great news for investors is that Cook is just 58, which means that he likely has many more years of running the company ahead of him.

Apple's advantage over the competition

Apple has proved very resilient when it comes to fending off rivals. It doesn't always have the largest market share with its core businesses (for example, it holds just 12% of the smartphone market), but what it lacks in market share it makes up for in pricing power.

Apple's brand is powerful, so consumers are generally willing to pay higher prices for the company's premium devices. For example, when Apple released the iPhone X last year, many were skeptical that buyers would pay $999 for a smartphone. But the iPhone X was a smashing success. Apple's latest flagship device, the XS, follows in the same pricing footsteps. In fact, for the fourth quarter of fiscal 2018, Apple's average selling price (ASP) for iPhones jumped to $793, up from $618 in the year-ago quarter.

This boost in ASPs allowed Apple to increase its iPhone revenue by 29%, even though unit sales were flat versus the year-ago quarter.

But pricing power is just one advantage. The company's brand power is also helping it earn more money from its customers through its services business. Apple's services segment (which includes the App Store, Apple Music, Apple Pay, AppleCare, etc.) has grown its revenue from $24.3 billion in 2016 to $37.2 billion in fiscal 2018. And the company says it's on track to double its services revenue from 2016 levels by the end of 2020.

Services are the company's second-largest revenue segment behind the iPhone, which proves that the company's competitive advantage isn't just tied to the smartphone market, but also to the vast technology services market.

Apple's ecosystem makes it easy to keep customers hooked into buying apps, devices, and services. And that has created a massive hurdle for rival technology companies trying to unseat Apple from its dominant position.

Apple's fantastic financial condition

Aside from growing its revenue and earnings under Cook over the past seven years, Apple has performed very well lately. In its most recent quarter, revenue rose 20% year over year to $62.9 billion, earnings per share spiked 41% to $2.91, and gross margin was 38.3%. For the full 2018 fiscal year, sales were up by 15.8% versus fiscal 2017, and net income jumped by 23%.

But one of the most notable indicators of the company's strong financial position is the fact that it has $237 billion in cash. That stockpile allows Apple to purchase smaller companies that it needs to stay competitive. It can also be used to buy back stock (as Apple has done consistently, lately), which creates a lot of shareholder value.

So Apple has tons of cash to expand into new markets, invest in new technologies (like augmented reality glasses and autonomous vehicles), or buy smaller companies that can strengthen its competitiveness even more.

So is Apple stock risky?

Of course, there are risks to consider with Apple stock, the main one being its dependence on iPhone sales -- which are slowing. The company brings in about 59% of its total revenue from sales of the devices. Rising ASPs are great, but that can't continue indefinitely.

Apple will need to eventually balance out its revenue with another device, or by growing its services segment. If it fails to do either, then that would be a bit troubling.

Additionally, recent news about Apple potentially getting caught up in a trade war between the U.S. and China has caused some concern among investors. Nothing has been decided on this front yet, but it's another potential risk to investors.

Over the long term, though, Apple's stock looks pretty safe. The company has a strong leader in Tim Cook, has substantial competitive advantages over its peers, and is in great financial shape. The stock will fluctuate with other tech stocks from time to time, as it's doing now. But over the coming years, Apple should be able to maintain a strong position in the tech sector -- and reward shareholders as it does.

Chris Neiger has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Apple and is long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.