The technology sector is driving the stock market to new highs with the S&P 500 (^GSPC 1.02%) and Dow Jones Industrial Average both closing at record levels on Jan. 23.

The focus remains on the "Magnificent Seven" companies, a term coined by Bank of America analyst Michael Hartnett to describe the seven largest tech-focused companies in the S&P 500 -- Microsoft, Apple, Nvidia, Amazon, Alphabet, Meta Platforms, and Tesla. Combined, they make up 28.8% of the index.

The Magnificent Seven dominate the U.S. stock market, but expand your view to the top 20 tech-focused companies, and they make up 35.8% of the S&P 500. They include the Magnificent Seven plus Broadcom, Adobe, Salesforce, Advanced Micro Devices, Netflix, Cisco, Intel, Oracle, Intuit, Qualcomm, ServiceNow, IBM, and Texas Instruments.

Whether you're invested in these specific companies or not, these changing market dynamics affect us all. Here are the pros and cons of a top-heavy market and why tech makes up an even larger share of the S&P 500 than folks realize.

A person wearing headphones puts their hands over their mouth while looking at a laptop screen in a surprised manner.

Image source: Getty Images.

Tech is bigger than you think

The SPDR S&P 500 ETF (SPY 0.95%) is built to mirror the performance of the S&P 500, so we'll use its composition to get a better reading on the market.

If you look into the fund, you'll find the weights by company and sector. Information technology makes up 28.9% of the fund. How is that possible when the 20 previously mentioned tech-focused companies make up 35.8%? The answer comes down to how the market defines a "tech" stock.

Amazon and Tesla are considered consumer discretionary companies, not tech. Alphabet, Meta Platforms, and Netflix are the three largest companies in the communications sector. The weight of those five companies alone is 11.5% of the S&P 500. So really, the tech sector plus these five companies is a staggering 40.4% of the market. Throw in some of the largest non-tech stocks like Berkshire Hathaway, Eli Lilly, JPMorgan Chase, UnitedHealth Group, Visa, Johnson & Johnson, ExxonMobil, Home Depot, Mastercard, and Procter & Gamble, and that's over 51% of the S&P 500.

The ripple effects of a concentrated market

The market cap of the S&P 500 is over $40 trillion. The sheer value of the tech sector and other largest companies is hard to comprehend. For context, the entire value of the Shanghai stock market is about $6 trillion.

In addition to the dollar value of these large companies, it's important to understand this heavy concentration means a relatively small number of companies are driving the stock market and potentially your portfolio. If you don't own these companies or you have small positions in them, then the performance of your portfolio is going to vary widely from that of the S&P 500, and even more so from that of the Nasdaq Composite. And if you have large positions in those companies, in addition to exchange-traded funds based on the major indexes, you're likely even more concentrated in those stocks than you may realize.

Individual investing is all about making wise decisions to achieve your financial goals. An individual isn't like a professional money manager or fund manager whose performance is constantly compared to the market. But still, a lot of financial planning is based on estimated market returns over time. A good rule of thumb is that the S&P 500 averages around a 9% to 10% annual return. But just because you're invested in the stock market doesn't mean you should expect to achieve a similar return to the S&P 500 unless you own the stocks that are steering the index.

2022 and 2023 were perfect examples of these market dynamics. In 2022, the S&P 500 fell 19.4%, and the Nasdaq Composite lost a third of its value. Unsurprisingly, the tech, communications, and consumer discretionary sectors led that decline. If you were underweight in these sectors, you probably outperformed the market in 2022.

^IXIC Chart

Data by YCharts.

The same thing happened last year, only the market went up with these three sectors contributing the bulk of the market's gains. If you were underweight these sectors, you probably underperformed the market last year.

^IXIC Chart

Data by YCharts.

The stock market hasn't always been this way. There used to be less concentration in a single sector, let alone a small number of companies. Back in 2014, the 10 largest companies by market cap were (in order): Apple, ExxonMobil, Alphabet, Microsoft, Berkshire Hathaway, Johnson & Johnson, Walmart, Chevron, Wells Fargo, and Procter & Gamble. That's much more diversification across sectors.

If we go back 20 years, the 10 largest companies were Microsoft, ExxonMobil, Pfizer, Citigroup, General Electric, Walmart, Intel, Cisco Systems, Johnson & Johnson, and IBM.

Be aware of the disconnect between your portfolio and the market

At the end of the day, investing in the stock market is about making money. As Peter Lynch famously said, "The stock doesn't know you own it." It matters little where the gains come from as long as there are gains over time.

Just realize that if the S&P 500 is up, it's probably thanks to large tech-focused companies, and same thing if it's down. If the trend continues, the market could become even more concentrated.

You might not be invested in the S&P 500, or you view many of those 20 large tech stocks as overvalued. As a result, you'll have to look for other opportunities in the market. There's nothing wrong with that -- you should always invest in a way that suits your risk tolerance.

The key is to fully understand what's driving the returns in your portfolio. Now more than ever, there's a dichotomy between large tech-focused companies and the rest of the market. Given the cyclicality of the tech sector, I would expect the S&P 500 to be more volatile going forward too.