Electronic Arts (EA 1.30%) has had a heck of a run over the past half-decade. The video game maker's share price is up nearly tenfold since mid-2012, making it one of the market's best-performing stocks during this time:

EA Chart

EA data by YCharts.

Electronic Arts has continued its impressive run in 2017, rising more than 40% so far this year. More important to today's investor, however, is that the hard-charging game publisher appears poised to reward investors with even more gains in the years ahead. In fact, here are two reasons that Electronic Arts' best days may still be yet to come.

Esports explosion

Imagine a stadium filled with thousands of fans cheering on their favorite teams. The excitement is palpable, with the crowd ready to erupt at every turning point in the game. Millions more fans around the world are eagerly watching the live stream of the sold-out event. And in the middle of it all are the game's most elite players battling for a championship.

Am I describing NFL football, or perhaps World Cup soccer? While that certainly could be the case, more and more often this scene is occurring in the burgeoning world of esports. In this new arena, the players are competitive gamers, and their virtual battles are increasingly taking place inside video games such as Electronic Arts' Madden NFL and FIFA Soccer.

Electronic Arts' FIFA 17 Ultimate Team Championship Series in Berlin, Germany

Electronic Arts' FIFA 17 Ultimate Team Championship Series in Berlin, Germany. Image source: Electronic Arts.

Esports' growth has been staggering -- and it's just getting started. The worldwide audience for esports surged 36.6% to 323 million in 2016, according to market-intelligence company Newzoo, and is projected to exceed 589 million by 2020. Meanwhile, esports revenue surged 51.7% last year to $493 million, and is expected to grow to $1.5 billion by 2020.

To capitalize on this megatrend, EA's competitive gaming division recently inked deals with ESPN (a Disney property) and the NFL Network to expand coverage of its esports tournaments. ESPN agreed to televise and stream EA's FIFA Ultimate Team Championship Series in more than 60 countries around the world, while the NFL Network signed on to broadcast EA's Madden NFL Championship games.

To further boost distribution, EA struck agreements with Alphabet subsidiary YouTube, Amazon subsidiary Twitch, and Facebook to live-stream several of its esports events. Together, these deals should broaden Electronic Arts' audience and solidify its position as a primary beneficiary of esports' incredible growth.

Margin expansion

While esports are boosting game sales and player engagement levels, another major trend is helping to lift EA's profits: the industrywide shift toward digital distribution. Digital downloads are less costly than shipping physical game packages, and they allow for additional monetization techniques such as the sale of in-game content -- both of which have led to higher margins and overall profits for video game makers.

Electronic Arts' gross margin improved to 73.2% in fiscal 2017, up from 69.2% in 2016; it was 62.3% back in fiscal 2014. Fueling that increase was a 20% jump in digital sales -- to more than $3 billion -- over the past year. "We generated record net sales and operating cash flow in fiscal 2017, driven by our ongoing transition to digital as well as our increasing success with live services," CFO Blake Jorgensen said in the company's fourth-quarter press release.

Looking forward, EA expects its gross margin to rise to 74.9% in fiscal 2018, fueled by a larger percentage of digital game downloads and higher sales of in-game content. More digital revenue driving higher profits: That's a trend Electronic Arts investors can expect to continue for the foreseeable future, and one that should help the video game titan deliver further gains to shareholders in the years ahead.