The success of McDonald’s can be attributed in part to the taste of the iconic fast food chain’s shakes and burgers. But the real secret sauce has everything to do with how the company has quietly become more a real estate company than a restaurant chain.

About 85% of the company in 2016 was represented by franchisee-run locations—people who agree to operate individual McDonald’s restaurants with a licensed privilege to the branding. But rather than collect a lot in royalties or sell its franchisees cooking equipment, McDonald’s makes much of its revenue by buying the physical properties and then leasing them to franchisees, often at large mark-ups.

The company keeps about 82% of the revenue generated by franchisees, compared with only about 16% of the revenue from its company-operated locations, which is reduced by the expenses of running those operations, according to the investment blog Wall Street Survivor.

In a 2015 analysis of McDonald’s franchising, Businessweek cited estimates by Janney Capital Markets. The total sales for an average location clocked in at $2.7 million per store each year, with $1.7 million in gross profits after accounting for food and paper costs. But then there are also other expenses: rent, payroll, advertising, promotions, operating supplies, insurance, and more. Average operating income after accounting for all those expenses rounded out to a take-home of just $154,000 per year for a single franchisee.

The average rent per store amounts to about 22% of average gross profits each year for franchisees. The company has more than 36,000 locations across more than 100 countries, so that adds up quickly. Better put, McDonald’s has more than $30 billion in real estate assets, and annual profits that float around $4.5 billion, according to company financial disclosures.

The number of franchisee McDonald’s locations has been steadily growing, as the company-owned number has dropped slightly in the last decade.

The emphasis on real estate may also pay off for the company at tax time. The US tax code includes several provisions favorable to real estate investors and landlords (which US president Donald Trump also appears to have benefited from).

Consider depreciation. Some types of property—such as cars—lose value over time, so it makes sense to offer tax breaks for their lost value. Real estate, on the other hand, often increases in value over time, and yet the IRS allows owners to deduct depreciation from taxable rent. This is something that McDonald’s can very easily take advantage of, says Xian Sun, a professor of corporate finance at Johns Hopkins University. McDonald’s reported $1.39 billion in depreciation in 2016, but it’s unclear what portion of that was depreciation of real estate rented to franchisees. The company did not immediately respond to a request for comment.

Additionally, Sun pointed out, in the last two decades real estate values have increased, which means the overall collateral value of the company’s property has increased, too. So when McDonald’s wants to borrow money to make new investments, it can do so at relatively cheap rates.

The value of all that real estate also provides a lot of insulation when the company needs to weather fluctuations in the larger burger business, as consumer habits and larger economic headwinds shift. McDonald’s CEO, Steve Easterbrook, is being paid handsomely—more than $15 million a year—to navigate the company through what’s becoming a rough patch, in which sales have shrunk in the face of a more competitive market for three years in a row.

McDonald’s has been making all sorts of changes in the last year to try and keep up with fast casual brands such as Chipotle, Panera Bread Company, and others. It’s about to roll out a mobile ordering platform; it began offering all-day breakfast (to much celebration and success); and it recently announced it will be using fresh beef patties across the US for some of its burgers.

But even if those big ideas fizzle, the corporate bigwigs at McDonald’s can still collect their rent.