With the real estate market grinding to a near halt in the second half of 2022, it shouldn't be too much of a surprise that many real estate stocks underperformed the stock market in the recent downturn. But few were hit as hard as Redfin (RDFN -4.71%). Even after a recent rebound, Redfin is down by nearly 95% from its highs.

However, there could be light at the end of the tunnel. Here's a rundown of why Redfin has performed so poorly, the steps the company has taken to fix its problems, and a realistic look at what could happen with the beaten-down stock in the next year or two.

Why has Redfin fallen by 95% from the highs?

In a nutshell, the biggest reason Redfin's stock has performed so poorly is the U.S. real estate market essentially ground to a halt as mortgage rates skyrocketed and home prices increased 40% from pre-pandemic levels.

Just to name a few statistics, home sales fell 35% year over year in November, the largest decline on record. Home price gains in that month were the smallest year-over-year figure since the market was essentially frozen in May 2020 because of the onset of the COVID-19 pandemic. Meanwhile, the supply of homes on the market increased 15% year over year in early December, the largest inventory build since 2015, even though there were 20% fewer new listings. In other words, the inventory has grown because homes are lingering on the market, not because more people are choosing to sell.

Plus, Redfin made a couple of big acquisitions that (in hindsight) were a case of terrible timing. In 2021, Redfin acquired RentPath for $608 million in cash, and then in April 2022 the company bought mortgage lender Bay Equity Home Loans at the height of the housing boom for $137.8 million. Combined, these deals cost more than Redfin's entire current market cap and are a big reason Redfin's debt load went from $146 million heading into 2020 to nearly $1.7 billion now.

In addition, Redfin's iBuying business, RedfinNow, started having a difficult time finding homes to buy, and with rising rates, the cost of capital to fund this part of its business started to get too high. Fortunately, RedfinNow was relatively small compared with some other iBuyers, but Redfin still reported more than $300 million in inventory at the end of the third quarter of 2022.

Will we see a turnaround in 2023?

Redfin has been losing money at an alarming pace -- a $245 million operating loss through the first three quarters of 2022. But the company has taken steps to right the ship, including some difficult rounds of layoffs and pulling the plug on RedfinNow.

Redfin is choosing to focus on its core services businesses going forward, and it isn't difficult to see why. During the first nine months of 2022, the services side of Redfin generated over $250 million in gross profit. The "product" side, which primarily includes iBuying, operated at a negative gross margin. CEO Glenn Kelman said that after the layoffs, shutting down RedfinNow, and concentrating on its core business, he expects Redfin to be net profitable in 2024.

Last but not least, we're finally starting to see signs of life in the U.S. real estate market. On one hand, pending home sales as 2023 got under way were at their lowest level since 2015. On the other hand, mortgage rates have come down to their lowest level since September and we're seeing an uptick in mortgage applications as a result. In the week ended Jan. 13, mortgage purchase applications increased 25% over the previous week. Also, Redfin recently reported that its Homebuyer Demand Index, which measures things like home tour requests and online search volume, is up 6% over the past month.

Will Redfin's stock price recover?

To be perfectly clear, even in an ideal scenario, I don't see Redfin getting anywhere near its previous highs anytime soon. To recover from a 95% plunge would require the stock to rise to 20 times its current price. Maybe someday, but not likely in 2023.

However, Redfin could certainly rebound significantly from the current levels if things go well. If the real estate market normalizes and the company is able to achieve bottom-line profitability in 2024, the stock could double or more from where it is now. But for the time being, those are very big "ifs" and it's important for investors to understand there is a lot that needs to go right for Redfin to soar.