Telecom giant AT&T (T 1.02%) is vastly underperforming the S&P 500 in 2023. With just a few trading days left in the year, AT&T stock is down nearly 10% year to date while the S&P 500 has gained 24%.

AT&T faces its fair share of challenges, including a tough competitive environment, high debt levels, and an uncertain economy. But investors shouldn't let the stock's miserable performance in 2023 push them away. Here's why AT&T shares could come roaring back in 2024.

1. Steady subscriber gains

AT&T's core wireless business has slowed down since the pandemic, but the company is still winning subscribers at a healthy pace. AT&T reported postpaid phone net adds of 468,000 in Q3 of 2023, an improvement over the first and second quarters.

That's not as impressive as rival T-Mobile, which booked 850,000 postpaid phone net adds in Q3, but it handily beat Verizon's meager gain of 100,000 net postpaid phone subscribers. AT&T's churn remained low -- just 0.79% for postpaid phones in the third quarter. That compares to 0.9% for Verizon.

Beyond wireless, fiber internet is a long-term growth opportunity for AT&T. Fiber growth is ultimately limited by how rapidly the company can build out its network, which is a capital-intensive process. AT&T's fiber network passed 20.7 million locations at the end of the third quarter, up from 15.5 million two years prior. The penetration rate, or what percentage of those passed locations are paying fiber customers, now sits at 39%.

AT&T is losing customers for its legacy broadband internet offerings, but the fiber business is picking up the slack. Fiber net adds totaled 296,000 in Q3, enough to push the overall broadband subscriber count slightly higher. Fiber carries a higher price tag for customers than legacy broadband, so broadband revenue can increase even if overall broadband subscriber growth is sluggish.

The state of the economy will impact AT&T's results in 2024, but even with the inflation and economic uncertainty of 2023, the company has managed to keep winning customers.

2. Rising free cash flow

AT&T expects to generate $16.5 billion in free cash flow in 2023. That's up from a previous outlook calling for at least $16 billion. It's also a significant improvement over the $14.1 billion in free cash flow the company churned out in 2022.

AT&T's free cash flow has a lot of moving parts. The timing of customer payments, the timing of capital spending, and distributions from DirecTV all push and pull this important metric. The company is reportedly considering selling its 70% stake in DirecTV, which would simplify the situation.

Looking ahead to 2024, the intensity of AT&T's capital spending should fade a bit as the company passes the peak of its 5G investment cycle. AT&T hasn't provided guidance yet, but CFO Pascal Desroches does see "a step-down in capex from the elevated levels we've been at in '22 and '23."

Lighter capital spending combined with continued subscriber gains should push free cash flow higher in 2024, all else being equal. Another factor could be AT&T's recent decision to revamp its wireless network with more flexible radio access network technology. AT&T will spend as much as $14 billion over five years installing hardware and software that will reduce complexity, increase flexibility, and lower costs. Any savings in capital spending can be reallocated to other areas, like fiber internet, to boost growth.

Barring an economic catastrophe, AT&T's free cash flow should continue to move higher in 2024.

3. A dirt cheap valuation

AT&T is valued at about $119 billion. Based on the company's guidance, the stock trades at a price-to-free-cash-flow ratio of just over 7.

One knock on AT&T as an investment is the company's high debt levels. It had $138 billion in debt at the end of the third quarter. With interest rates no longer at rock-bottom levels, as AT&T refinances this debt over time, the company's interest payments could rise.

The good news is that AT&T's debt maturities are spread out and that it plans to use cash on hand to settle maturities over the next two years. The average weighted interest rate AT&T pays on its debt is almost certain to increase eventually, but it won't be happening anytime soon. AT&T's debt is a problem, but a manageable one.

AT&T isn't a fast-growing company, but the stock's valuation seems far too pessimistic. If the telecom giant can succeed in boosting free cash flow in 2024, a higher multiple for the stock could be in the cards.