Since 2018, 22 states and the District of Columbia have legalized gambling. With estimates on the size of sports gambling's black market pushing $150 billion and prohibition slowly ending, the opportunity is truly immense.

There are plenty of ways to invest in this trend, but Penn National Gaming's (NASDAQ:PENN) decision to purchase a 36% stake in -- and partner with -- Barstool Sports puts it in the best long-term position to capture the mammoth opportunity. Here's why:

3 friends watching television and drinking beer at a bar.

Image source: Getty Images.

A perfect sports gambling partner

As of a few months ago, Barstool Sports attracted 66 million monthly active users (MAUs) to its ecosystem of media offerings. What's more interesting: Its gigantic, cult-like following of gamblers is ideal for Penn National's strategy.

Out of Barstool's 66 million MAUs, 44% gamble on sports weekly, totaling just over 29 million weekly sports betters. For comparison, it will take the entire season for the NFL -- the most popular sports betting league in the nation -- to reach 33.2 million total sports gamblers, according to the American Gaming Association.

Barstool's following is also much younger and skews more male than Penn's original customer base had been before the partnership. Sports gambling is dominated by younger generations and is engaged with predominately by men, making those two characteristics of Barstool's following enviable as well. While Penn's demographic pre-Barstool was older and more female than the typical sports gambler, Barstool's following now allows Penn to access a more interested audience for sports gambling.

The sports-media behemoth's scale and demographic is perfect from a user acquisition cost standpoint for Penn. Competition like DraftKings has to give equity away to Michael Jordan -- who joined the company as a special advisor in September -- and fund expensive TV ad campaigns in order to attract new users. Barstool's personalities -- like Dan Katz and Kevin Clancy -- simply need to post videos of themselves eating food, gambling, playing video games and talking to advertise to millions of people for free and on demand.

Even without expensive marketing programs, Penn National was able to break DraftKings' record for most opening-weekend gambling app downloads. For Penn: No TV ads, no celebrity partnerships, no problem; that's what a partnership with Barstool offers. The fact that Barstool's gambling function is only currently live in Pennsylvania makes that all the more impressive. New states will be added in the coming quarters.

Other cash-generating assets

While Penn's customer acquisition strategy for sports gambling is extremely efficient, operating and expanding the sportsbook still will not be free. That's why the makeup of Penn National Gaming's casino portfolio is also important.

Penn's properties consist entirely of regional assets. Instead of flying to locations in the case of MGM Resorts International or Wynn Resorts, customers more frequently drive to Penn's locations, a big advantage as air travel remains depressed.

The result? Penn's casinos returned to free cash flow in June and were already back to 94% of pre-COVID revenue. This kind of comparatively quick recovery makes funding Barstool's launch easier, and the share price has certainly responded.

Penn National Gaming 5-year percent change price chart.

Image source: YCharts.

While Penn's brick-and-mortar assets are not as exciting as Barstool Sportsbook, they are nonetheless important for providing cash and stability to fund the company's growth initiatives. Having $2.05 billion in cash on the balance sheet helps with that as well. Barstool will fuel Penn's growth, but cash-generating assets and liquidity will allow that growth to continue unimpaired.

Investing in sports gambling

I believe Penn's decision to purchase a stake in Barstool Sports will go down as one of the best merger and acquisition decisions of my lifetime. Barstool's gigantic, relevant following is hungry for a Barstool-themed sportsbook. Fortunately, that has officially arrived.