It seemed like a wild gamble a year ago.

As rumors heated up that Apple was preparing to launch a new iPhone in the $1,000 range, the pile on from the tech pundit community came in swiftly. The reported features of a then-unnamed iPhone wouldn't be enough to justify the $1,000 price and spur a new "super cycle" of sales growth last seen in 2014 and 2015 after the launch of the iPhone 6.

It turns out the critics were only half right.

While iPhone sales growth is slowing — sales were essentially flat year over year for the June quarter and Apple slightly missed sales estimates — the pricey iPhone X has helped maximize profitability out of the company's most important product. Apple said the average selling price (ASP) of the iPhone last quarter was $724, smashing expectations. And that ASP, juiced by the thousand-dollar iPhone X, boosted Apple's profits to a whopping $2.34 per share, up 40 percent year over year and beating Wall Street's expectations of $2.18 per share.

In short, Apple's iPhone sales may not be growing at the dizzying pace they were a few years ago. But Apple has figured out a $1,000 iPhone is the best way to squeeze even more profits out of a flattening user base.

The trend doesn't just affect Apple, by the way. The entire smartphone market has started to shrink, according to research firm Gartner. But Apple is one of the few companies that can keep smartphone profits exploding in that tough market. Earlier this week, Samsungreportedlackluster Galaxy S9 sales, which hurt its profit growth.

Apple may be able to do it again next year. According to the reliable tech analyst Ming Chi Kuo of TF International Securities and other media reports, Apple will launch a larger version of the iPhone X this year. If the "regular" iPhone X starts at $999, then you can expect that plus-sized version to go for at least $1,099, assuming Apple keeps a similar pricing structure for each tier of iPhone model. That puts Apple in a good position to keep the iPhone ASP growing throughout 2019.

The iPhone is Apple's magical money-making machine. And while side businesses like digital services and accessories are showing rapid, healthy growth, Apple has figured out a new formula to keep profits exploding simply by introducing pricier versions of its most important product.

There are a few troubling trends that could dampen iPhone profits. The company started offering cheaper battery replacements at $29, which can keep iPhones from slowing down and extend their life by an extra year or two. That could mean some users will be able to resist plopping down $1,000 for a new iPhone until they absolutely need to. Still, CEO Tim Cook said on the company's earnings call Tuesday that Apple isn't paying attention to the number of battery replacements, and it isn't concerned about how it could affect upgrade numbers.

The key to Apple's big June quarter wasn't that it out-innovated its competition or dreamed up a brand new business. It's really as simple as this -- it convinced millions of people to pay a lot more for their new iPhone.