Shares of Palo Alto Networks (NYSE:PANW) surged 17% on June 1 after the cybersecurity company posted impressive third quarter earnings and robust guidance for the current period. Revenue rose 25% annually to $431.8 million, beating estimates by nearly $20 million. Non-GAAP earnings grew 33% to $0.61 per share, also topping expectations by six cents.

Billings rose 12% to $544.1 million, and deferred revenue -- a key indicator of future demand -- surged 51% to $1.6 billion. For the current quarter, Palo Alto anticipates 20% to 23% annual sales growth, which matches the consensus forecast of 21%. On the bottom line, it expects non-GAAP earnings growth of 56% to 60%, which also beats expectations for 48% growth.

A padlock on a keyboard.

Image source: Getty Images.

Those headline numbers look solid, but here's the problem -- Palo Alto still isn't profitable on a GAAP basis. Its GAAP loss only narrowed slightly from $0.73 to $0.67 between the third quarters of 2016 and 2017, and that figure won't likely turn positive anytime soon. Let's see why Palo Alto struggles to turn a GAAP profit, and how it can improve the situation.

Why GAAP profits are out of reach for Palo Alto

The big disparity between Palo Alto's non-GAAP and GAAP numbers stems from stock-based compensation, or SBC expenses, which are excluded from the former but included in the latter.

The exclusion of stock-based compensation from a company's bottom line is controversial. Young companies with weak cash flows often use big stock bonuses to attract top talent, then exclude them as "temporary" charges, because they obscure the "true" growth of the company. However, Warren Buffett has criticized the practice, calling such numbers "phony" and noting that they ignored "real and recurring expenses."

Palo Alto's SBC expenses rose 7% annually to $120.6 million -- or 28% of its revenue -- during the third quarter. That's why excluding that figure produces double-digit non-GAAP earnings growth, but including it results in a big GAAP loss. This might be acceptable with a younger company, but Palo Alto's non-GAAP free cash flow of $162.6 million last quarter indicates that it can easily replace some stock bonuses with cash payments.

Palo Alto isn't the only cybersecurity company with this problem -- its industry peer FireEye (NASDAQ:FEYE) saw stock-based compensation gobble up 25% of revenue last quarter. But here's the key difference -- FireEye reduced this expense by 32% annually during the quarter, thanks to the company's ongoing cost-cutting efforts, as Palo Alto's rose.

Operating outside of Silicon Valley makes a huge difference

Palo Alto and FireEye's SBC expenses are lofty, because they both operate in Silicon Valley, where the competition for top tech talent is fierce and costly. Job applicants might want big stock option packages on top of their cash salaries -- which makes it tough to reduce stock-based compensation as a percentage of revenue.

Palo Alto founder Nir Zuk is also a firm believer of giving employees big stakes in the company. When the company first went public, Zuk agreed to dilute his own share to 5% (versus the typical 25% cut for founders) so that early hires could own a meaningful stake in the company.

But if we compare Palo Alto and FireEye to cybersecurity companies that aren't based in Silicon Valley, the difference in this line item is astounding. Check Point Software, based in Israel, spent just 4% of its revenue on stock-based compensation last quarter and is profitable on a GAAP basis. Another Israeli firm, CyberArk, spent 9% of its revenue on SBC expenses last quarter and also remains profitable on a GAAP basis.

Should Palo Alto Networks move elsewhere?

I'm not suggesting that Palo Alto Networks needs to move overseas, but the high costs of operating in the Bay Area have already convinced many companies to expand to other regions. Palo Alto has already expanded domestically to New York, Texas, Virginia, and Washington, and it has offices in dozens of countries.

But for now, the bulk of Palo Alto's workforce remains in Silicon Valley, and it's unlikely that the company will move its corporate headquarters anytime soon. Therefore, investors shouldn't expect its stock-based compensation to significantly decline or for it to turn a GAAP profit in the near future.

So for now, investors should keep a close eye on Palo Alto's revenue, free cash flow, and cash equivalents -- which all rose annually last quarter -- as better indicators of its financial health. Its non-GAAP earnings growth still matters, but investors should remember that it doesn't mean that Palo Alto is a "truly" profitable company.

Leo Sun has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Check Point Software Technologies. The Motley Fool recommends CyberArk Software, FireEye, and Palo Alto Networks. The Motley Fool has a disclosure policy.