Breakthroughs in artificial intelligence (AI) have been a major stock market investing theme in recent years, amid growing optimism that the technology's potential to transform various industries is just getting started.

One application where AI is proving critically important is cybersecurity. Market leaders like Palo Alto Networks (PANW 1.39%) and CrowdStrike (CRWD 3.36%) are using machine learning algorithms and AI-powered intelligence tools to stay ahead of increasingly sophisticated cyber threats. Both industry pioneers appear well-positioned to capture significant long-term growth opportunities in the expanding cybersecurity market.

But which stock would be the better buy for your portfolio right now? Here's what you need to know to make a more informed decision in 2025.

Humanoid robot using a computer interface.

Image source: Getty Images.

The case for Palo Alto Networks

As titans in the cybersecurity landscape, Palo Alto Networks and CrowdStrike share several commonalities within competitive segments, yet each has established unique focus areas. Palo Alto has built its reputation on next-generation firewall technology, combining specialized hardware and software that functions as the first line of defense barrier for organizational networks.

Throughout the past decade, the company has evolved into a more comprehensive security platform, integrating artificial intelligence and machine learning (AI/ML) capabilities across an expanding portfolio of cloud-based products. The company's Precision AI framework is intended to revolutionize cybersecurity through autonomous threat detection and response.

The effort has propelled Palo Alto to become the industry's largest pure-play cybersecurity company by revenue, rewarding shareholders handsomely with the stock delivering a fantastic 356% return in the last five years.

By all indications, Palo Alto's operating and financial trends are set to continue into 2025. The latest fiscal first quarter results (for the period ended Oct. 31, 2024) showed revenue climbing by a solid 14% year over year, alongside a 13% increase in adjusted earnings per share (EPS). Even more impressive momentum in next-generation services (NGS), including its AI-powered subscription offerings as annualized recurring revenue (ARR) for NGS, grew by 40% from last year.

This growth runway has translated into a premium valuation for Palo Alto, with shares trading at 57 times the consensus 2025 EPS as a forward price-to-earnings (P/E) ratio. Nevertheless, the stock still stands as a relative bargain next to CrowdStrike's forward P/E of 92, an important consideration when comparing the two stocks. Investors confident in Palo Alto's ability to maintain its cybersecurity leadership and benefit from new AI use cases over the long run have a compelling reason to buy shares today.

PANW PE Ratio (Forward) Chart

PANW PE Ratio (Forward) data by YCharts.

The case for CrowdStrike

In contrast to Palo Alto's positioning in network security, CrowdStrike dominates in endpoint protection, securing end-user devices as they access network data across an increasingly diverse Internet of Things (IoT) ecosystem.

The company has been successful in expanding its offerings, incorporating services like identity protection, threat intelligence, and exposure management into its unified Falcon platform. AI/ML capabilities are deeply integrated within the architecture, powering advanced threat detection, workflow automation, and predictive analytics. This software-first strategy has helped drive stronger overall growth than Palo Alto, propelling CrowdStrike's shares to climb 34% over the past year.

In the third quarter (ended Oct. 31, 2024), CrowdStrike's revenue increased 29%, while adjusted EPS rose 13% from last year. Customer adoption of additional service modules within the Falcon subscription ecosystem has been a key growth driver.

Management projected confidence in the outlook by hiking its full-year guidance. It targeted 2025 adjusted EPS between $3.74 and $3.76, representing a 22% increase at the midpoint over 2024. Notably, this growth rate surpasses Palo Alto's company guidance for 2025 adjusted EPS growth of approximately 13%.

Ultimately, CrowdStrike's ability to capture market share, particularly in emerging cybersecurity categories, helps make the case for it being the better stock to buy now.

Decision time: It's a tough choice

Choosing between these two exceptional stocks presents a challenge, as both companies show strong potential for price appreciation in the coming year.

If forced to pick just one stock more likely to deliver superior returns in 2025, I believe CrowdStrike has the edge given its stronger earnings momentum, which the market typically rewards. While you should recognize the potential for volatility around quarterly results, CrowdStrike is a great option to gain exposure to AI themes within a diversified portfolio.