Meta Platforms (META 1.54%), the tech giant formerly known as Facebook, went public at $38 per share on May 18, 2012. If you had invested $1,000 in that IPO, your stake would be worth nearly $9,000 today. But if you had waited and invested that $1,000 in the company after its stock plunged below $18 that September, your stake would be worth nearly $19,000 today.

Either way, your original investment would have easily outperformed the S&P 500, which has risen about 260% since Meta's first trading day. Let's look back at how the company repeatedly defied the bears, and where this constantly evolving tech titan might be headed over the next few years.

Meta CEO Mark Zuckerberg.

Image source: Meta.

How the market underestimated Meta's growth potential

When Meta went public, it was a much smaller company. The social media platform's flagship app Facebook served 901 million monthly active users (MAUs) in the first quarter of 2012.

Instagram, which Meta bought right before its initial public offering (IPO), started 2013 with just 90 million MAUs. The company wouldn't acquire Oculus and WhatsApp until 2014.

Meta ended its latest quarter with 2.91 billion MAUs on Facebook, as well as 3.58 billion monthly active people (MAP) across all of its platforms. In other words, nearly half of the world uses at least one of Meta's apps.

That expansion silenced the critics, who believed Facebook would fade away like Myspace and Friendster, and led to years of soaring revenue and profits:

FB Revenue (TTM) Chart

Data source: YCharts.

How the market overestimated the regulatory threats

As Meta expanded, it encountered several major scandals. When the Cambridge Analytica breach exposed the data of over 50 million users, privacy advocates scrutinized the company's data-sharing practices and targeted ads, and it was repeatedly accused of facilitating the spread of fake news stories.

The deadly Capitol riot in January, which resulted in Facebook banning former President Donald Trump from the platform, sparked questions about the company's ability to control its own content. A whistleblower also recently accused the company of repeatedly refusing to improve the safety of its own platforms.

As a result, Meta now faces a lot of pressure from government regulators. It has been fined in the U.S. and Europe for data privacy violations, CEO Mark Zuckerberg has been repeatedly summoned to Congressional hearings, and the company currently faces demands from the Federal Trade Commission (FTC) to spin off Instagram and WhatsApp.

Each time a new scandal broke, the bears claimed Meta's high-growth days were over. But the stock bounced back every time for two simple reasons: Meta's massive user base makes it a default choice for most advertisers alongside Alphabet's (GOOG 0.37%) (GOOGL 0.35%) Google, and many of Meta's overseas users likely don't care about its U.S.-based scandals.

What does the future hold for Meta?

Meta still generates nearly all of its revenue from targeted ads on Facebook and Instagram. That core business faces some near-term challenges as Meta copes with Apple's (AAPL -0.57%) recent privacy changes on iOS, which enable users to opt out of any app's data-tracking features.

But over the long term, Meta's advertising business will likely evolve as it relies more on first-party data and contextual ads. It will also keep expanding its oft-overlooked "others" division, which is growing faster than its advertising business as it sells more Oculus virtual reality headsets and Portal devices. It recently added a pair of Ray-Ban smart glasses to that hardware ecosystem, and it plans to launch additional augmented reality devices in the near future.

If we look even further ahead, Meta -- as its new name implies -- plans to evolve into a metaverse company, that blurs the lines between the physical and digital worlds by merging its social networking, VR, and AR ecosystems. That unification could expand Meta's ecosystem far beyond PCs and smartphones while locking even more users into its services.

Should you still buy Meta today?

I sold my shares of Meta in early January because I believed the incoming regulatory threats and iOS changes would be too difficult to overcome. But like many myopic investors, I underestimated its resilience -- and its stock has rallied nearly 25% this year even as it faced crisis after crisis.

If you believe Meta will overcome its latest regulatory and platform challenges, then its stock still looks like an attractive investment at 23 times forward earnings. That price-to-earnings ratio makes it the cheapest FAANG stock, as well as one of the most affordable plays on the booming metaverse trend.