At the beginning of this year, Square (NYSE:SQ) CFO Sarah Friar told analysts they should expect relatively modest EBITDA margin expansion in the mid-single digits of percentage points over the next few years. "We think that's probably the right balance of being able to invest to grow against showing you that we're going to grow prudently and show leverage where we can," she said on the company's fourth-quarter earnings call.

Since then, it posted margin expansion of 19 percentage points and 8 percentage points in the first and second quarters, respectively. With the second-quarter report, management guided for just 5 percentage point EBITDA margin expansion. And Friar recently said the midpoint of the full-year 2017 EBITDA margin shows 7 percentage points of expansion at Deutsche Bank's 2017 Technology Conference.

It turns out the analysts who thought Square was being too conservative were right. While Friar wasn't entirely off in her early estimate, it's important to look at what's leading to Square's outperformance on the bottom line.

A hand on a Square Stand POS system.

Image source: Square.

Upside across the board

Friar said Square is seeing upside across its entire range of products. That's important to note because the vast majority of its revenue comes from processing payments, but payment processing carries a lower-margin profile than its other products like Square Capital. Square's ability to grow revenue across its suite of products means that it's achieving higher operating leverage than expected, not that it's simply selling more higher gross margin products. That bodes well for continued margin expansion going forward.

The biggest benefit to Square's top line has been taking a larger share of its existing merchant's book of business. Two new products have been instrumental in that trend: Invoices and Virtual Terminal. Both allow merchants to take payments without the need to boot up an Android or iDevice. Virtual Terminal allows sellers to key in credit card information in their web browser (for things like phone orders) and the transaction shows up in their Square dashboard and they can send digital receipts. Invoices also work on a PC web browser, and allow merchants to set up recurring payments.

The existing customer base continues to take more products, according to Friar. As merchants take two, three, or more products from Square, they get locked into its ecosystem. They're also incentivized to make as many transactions as they can with Square, since they automatically show up on their analytics dashboard. That saves time and can help merchants make better decisions about their businesses.

Overall, Square's outperformance on the top line has allowed a larger percentage of sales to trickle down to the bottom line.

Is Square struggling to find investment opportunities?

While it's great to see it outperform in the short term, it does call into question the long-term opportunity for Square. The mid-single-digit guidance Friar provided at the beginning of the year was a number toward which she planned to manage the business. In other words, Square could show a much greater EBITDA margin today if it really wanted to, but it would sacrifice reinvesting profits into growing the company.

Friar laid out the massive opportunity for Square in the payments processing market during the company's investor day in May. Friar estimates $3 trillion in credit and debit card gross payment volume in the U.S. alone. For reference, Square processed just $57 billion in payments over the last 12 months. The market is even bigger when you expand internationally, where Square is just getting started.

To that end, Square is boosting its marketing spend. Sales and marketing expense grew 53% year over year. It also accounted for a higher percentage of sales. (Still, it seems Friar still wants to manage marketing spend toward a payback rate of three to four quarters.) Meanwhile, operating leverage has stemmed from better returns on product development, SG&A expenses, and fewer transaction and loan losses.

So it seems, Square is still pushing investments in onboarding new customers and upselling existing merchants. The efforts are paying off and allowing it to show improved leverage in other operating expenses. Therefore, it's not hurting for investment opportunities. It just has more money than it can invest.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.