Shares in Apple (AAPL -0.69%) have risen 52% since Jan. 1 despite facing macroeconomic headwinds, reductions in consumer spending, and a 3% year-over-year revenue decline for fiscal 2023. The company's stock performance over the last 12 months pretty much sums up exactly why it remains a favorite for countless investors.

AAPL Chart

Data by YCharts

Apple has repeatedly proven its resilience and ability to outperform its competitors no matter the market conditions. This chart shows its stock delivered significantly more growth over the last five years than some of the biggest names in tech, illustrating the consistency of its shares. The tech giant's years of reliability have created loyal investors who stick with Apple even in uncertain times.

There remain plenty of reasons to be bullish about the company over the long term. However, recent challenges could affect its stock going forward, which prospective investors should be aware of.

So, here are two reasons to buy Apple stock and one reason to sell.

Reason to buy No. 1: Leaning less on products and prioritizing digital offerings

Repeated dips in Apple's revenue over the last year came alongside dwindling sales in its four product segments. As inflation spiked, consumers were less likely to splurge on device upgrades. However, the bright spot for the second year running was Apple's services division, which posted revenue growth of 9% year over year, outperforming all other segments.

Services include Apple's digital sales from the App Store and subscription-based platforms like Apple TV+, Music, and iCloud. The segment is currently the second-highest-earning part of the company's business after the iPhone. Meanwhile, it could be on track to eventually overtake Apple's smartphone division after two consecutive years of delivering more significant revenue gains.

The digital business's growth trajectory strengthens Apple's long-term outlook as it regularly hits profit margins above 70%. Comparatively, products' profit margins hover around 35%.

Services allow Apple to lean less on product sales, making it more resilient against economic fluctuation. In the past, the tech giant's stock has been hit hard by iPhone production issues or poor sales. However, that will be less of a concern the more services expand.

Reason to buy No. 2: Apple has the funds to expand and dominate almost any industry

Despite tumbling product sales, Apple ended its fiscal 2023 with $162 billion in cash, equivalents, and marketable securities. Meanwhile, the chart below shows its nearly $100 billion in free cash flow was more than any other company in the "Magnificent Seven."

AAPL Free Cash Flow Chart

Data by YCharts

Apple has accumulated significant cash reserves that have fortified its business. Even while the company faced multiple quarters of revenue declines this year, it continued to invest heavily in its high-growth industries like AI. In fiscal 2023, Apple's research and development spending increased by $3.6 billion, primarily due to a larger focus on generative AI.

Apple could be one of the most reliable investment options with the funds to overcome unforeseen challenges and continue expanding in lucrative industries.

Reason to sell: Product difficulties

It seems Apple's products business can't catch a break. In addition to consumer pullback, China is accelerating iPhone bans for government workers, and the company has had to halt sales of its latest Apple Watch in the U.S. after a patent dispute.

In recent months, China has introduced restrictions limiting government departments and state-backed companies across at least eight provinces from using iPhones and other foreign devices. The crackdown has increased from rules in September that saw agencies in Beijing and Tianjin restrict Apple smartphones.

China accounted for 19% of Apple's revenue in fiscal 2023. While the new rules only affect workers in select regions, for now, a broader clampdown could take a chunk out of earnings from a crucial market for Apple.

Moreover, an ongoing patent dispute between Apple and medical technology company Masimo led the company to stop selling the Series 9 and Ultra 2 versions of its Apple Watch in the U.S. this month. Masimo argued that the watches' blood oxygen reader infringes its patents, with the International Trade Commission invoking a ban during Apple's busiest season, Christmas.

According to Bloomberg, the watches are a $17 billion business, or 4% of the company's annual revenue. Apple is scrambling to change the algorithms on the devices that measure oxygen saturation. However, only time will tell how long the wearables will be off the shelves in the U.S.

Apple's services and significant cash reserves remain compelling reasons to invest in the company's stock, with current product hurdles unlikely to significantly affect its business over the long term. However, investors should monitor the company as additional product difficulties could affect its stock price over the next year.