When people think about real estate stocks, many turn their attention to real estate investment trusts (REITs). Although you can certainly do well with REITs and the regular dividends they offer, other types of real estate companies are also crushing it now, despite the looming threat of a recession.

Homebuilder LGI Homes (LGIH 0.88%) is one of those companies whose business is doing well despite all odds. Despite being among the smaller publicly traded players in the homebuilding arena, this mid-cap has spent the last 20 years making careful and precise decisions that allowed it to ride out the real estate crash of 2008, and have it poised to do the same with 2022's turbulent real estate market.   

Focusing on an underserved segment of the market

Although LGI Homes builds homes in major metro areas, it doesn't construct the kind that a lot of its peers seem to be focused on today. LGI Homes, instead, looks for opportunities on the edges of the market. In doing so, it has managed to carve out a significant niche for itself with both first-time homebuyers and those looking to move into age-limited communities.

The average home price for an LGI Home, as of Aug. 2 was $356,719, compared to the median existing-home sales price in June of $416,000. This pricing advantage isn't a fluke; it's part of the company's strategy.

Because new homes are often more energy-efficient than even those that have been retrofitted with modern energy-saving technology, homebuyers may be able to more easily budget their money when choosing a newly built property. Buyers also know they are unlikely to be facing large repair bills immediately with a new home. Both of these are factors that continually drive new home sales despite the varying behaviors of the wider real estate market.

Although LGI Homes only anticipates closing 7,500 to 8,300 homes in 2022,  This is on par with pre-pandemic sales. In 2019, it closed 7,690 homes, at an average price of $239,032.

There was a notable spike in nationwide new residential sales between mid-2020 and early 2022, according to Census Bureau data, that was certainly outside the norm. LGI's anticipated beating of 2019 numbers despite recession threats, home prices that are significantly above 2019 levels, and interest rates that continue to climb, point to an ongoing stable business regardless of the wider climate. 

Even with cancellations, interest and profits remain high

There's been a noteworthy rise in the cancellations of home contracts lately, and both builders and sellers have been feeling the impact. LGI Homes certainly has: The cancellation rate on contracts for its homes hit 20.8% in the first half of 2022, compared to just 14.8% in the first half of 2021.

Despite this, its second-quarter net income rose 4.4% year over year, largely because its average sales price per home rose by 28.7%. That increased LGI Homes' gross margin to 32% from 27% in the prior-year period. Management also anticipates going from 92 communities with homes for sale as of the end of Q2 to between 100 and 110 communities by the end of 2022, getting it back on par with pre-pandemic community building.   

Specialization has helped smooth out the financial bumps

Even though homebuilding is a highly cyclical industry, it says a lot about LGI Homes that it has consistently beat earnings forecasts throughout the last year -- in some cases, significantly. In Q3 2021, its contract cancellation rate and national mortgage interest rates were much lower than they were in Q2 2022, but despite this, its earnings have stayed more or less stable. The tendency of leadership to continue to conservatively gauge the company's performance is an indicator that regardless of the overall environment, financial self-awareness is strong.  

The current trend in earnings is largely due to the high demand for less expensive housing, which LGI Homes is more than happy to supply. Focusing on this particular niche has also allowed LGI Homes to grow exponentially  since it was founded in 2003.  Since going public in 2013, it has grown from a $369.38 million market cap to $3.69 billion. 

There are already hints of that future growth in its financials, especially when looking at real estate inventory over these same two periods. Between Dec. 31, 2021, and June 30, 2022, LGI Homes' real estate inventory rose from $2.085 billion to $2.633 billion. As a homebuilder, the only product you have to sell is real estate, so more of it should equal more revenue over time.