Buying and holding solid companies for the long run is a tried and tested way of making money in the stock market because it allows investors to benefit from the power of compounding and enables them to take advantage of secular growth opportunities in various industries. This is evident from the impressive gains that the S&P 500 logged in the past decade.

For instance, a $1 investment in the S&P 500 index in 2012 grew to $3.06 in 2021 after adjusting for inflation. So even though there are periods of volatility and years when the market remains in the red, history suggests that the stock market averages solid returns over the long run. This is evident from the returns generated by Apple (AAPL 0.52%) and Taiwan Semiconductor Manufacturing (TSM 2.71%) (TSMC) over the years.

A $3,000 investment in Apple stock seven years ago is now worth just over $19,000, assuming the dividends were reinvested. That translates into a healthy annual return of 30%. A similar investment in TSMC shares is now worth more than $12,400. It won't be surprising to see these stocks replicate such impressive returns in the future and at least double your money (if not more) by 2030. Let's look at the reasons why.

1. Apple

Apple has been a terrific investment over the past seven years, multiplying investors' wealth substantially thanks to the arrival of 5G smartphones and the growth of the company's services business. Looking ahead, Apple could continue to remain a top tech stock through the end of the decade thanks to the arrival of new growth drivers and existing catalysts.

For instance, 5G smartphones are going to be a key source of growth for Apple given the company's dominant position in this market. Ericsson estimates that 5G mobile subscriptions could hit 5 billion by 2028, which would be a huge jump versus the 870 million 5G subscriptions as of September last year. Even better, the 5G smartphone market could keep growing beyond 2028 because the penetration of 5G mobile subscriptions is expected to reach only 55% after five years.

With Apple's 5G-enabled iPhones making up eight of the top 10 best-selling smartphones of 2022, according to Counterpoint Research, the secular growth of this should be a tailwind for the tech giant. Meanwhile, Apple is reportedly going to launch an augmented reality (AR) headset this year, a move that will help it tap a massive market that's expected to generate over $105 billion in revenue by 2030.

Additionally, the diversification of Apple's services business into areas such as finance and healthcare could give its top line and margins a major boost by the end of the decade. These services are some of the reasons why New York University professor Scott Galloway forecasts Apple generating $1 trillion in annual revenue by 2030.

The company is expected to generate $388 billion in revenue this year, which means that it needs to clock an annual revenue growth rate of 14.5% through 2030 to hit the $1 trillion mark. A look at Apple's potential catalysts over the next decade suggests that it could indeed hit $1 trillion in annual revenue by the end of the decade.

Multiplying the estimated 2030 revenue by Apple's five-year average price-to-sales ratio of 5.67 would translate into a market cap of nearly $5.7 trillion in 2030. That's more than double the company's current market cap of just over $2.4 trillion, which is why investors with $3,000 in investable cash may want to buy shares of this tech titan.

2. Taiwan Semiconductor

TSMC shares' impressive returns over the past seven years were driven by growing semiconductor demand. The Semiconductor Industry Association estimates that global semiconductor sales hit $574 billion in 2022, up from $335 billion in 2015, expanding at a compound annual growth rate (CAGR) of 8%. McKinsey estimates that the global semiconductor industry could generate $1 trillion in revenue by 2030, matching the annual growth it witnessed in the past seven years.

TSMC is in a nice position to take advantage of the semiconductor industry's secular growth because it is the world's biggest semiconductor foundry that makes chips for major chipmakers. Counterpoint Research estimates that TSMC controlled 60% of the global semiconductor foundry market's revenue in the fourth quarter of 2022, way ahead of No. 2 Samsung's revenue share of 13%.

It is worth noting that TSMC increased its revenue share during the year from 56% at the end of 2021. The company's gains in the foundry space can be attributed to the growing demand for chips manufactured using advanced 5-nanometer process nodes. These advanced process nodes are going to play a critical role in the proliferation of artificial intelligence (AI) applications because they can compute large amounts of data in a power-efficient manner.

The semiconductor opportunity and TSMC's healthy market share tell us why the company is confident of posting a revenue CAGR of 15% to 20% over "the next several years." Even if TSMC misses the lower end of that range and it manages just 10% annual revenue growth through 2030, the company's annual revenue could hit $162 billion at the end of the forecast period (based on 2022 revenue of $76 billion).

Multiplying the estimated 2030 revenue by TSMC's current sales multiple of 6.2 (which is a discount to its five-year average sales multiple of 8.5) would result in a market cap in excess of $1 trillion. TSMC's current market cap is just over $449 billion, indicating that this semiconductor stock has the potential to double by 2030.

Given TSMC shares are trading at less than 14 times earnings, it would be a good idea for savvy investors to buy this stock if they have $3,000 to spare right now because it seems built for long-term growth.