Updated with comments from Jim Cramer.

While announcements regarding Android, self-driving cars and Google Fiber get more publicity, nothing has arguably been more important to Google's business than the improvements the company has been making to its mobile search engine and the search ads that run against mobile queries. Parent Alphabet's (GOOGL - Get Report) second-quarter results show those improvements are still paying huge dividends.

Three months after selling off on a first-quarter miss, Alphabet is up over 4% after handily beating analyst estimates. Revenue rose 21% annually (25% excluding forex) to $21.5 billion, an improvement from the first quarter's 17% growth. Adjusted EPS rose 20%, to $8.42.

The sales growth pickup was fueled by a 21% increase in Google segment revenue to $21.3 billion. That, in turn, was driven by a 24% increase in Google sites ad revenue to $15.4 billion -- mobile search and YouTube are behind most of the growth -- and a 33% increase in "Google other" revenue, which covers businesses such as Google Play and Nexus and Chromecast hardware lines, to $2.2 billion. The Google network sites business, which sells ads on third-party sites and has been stung by Facebook's rapid ad sales growth, grew just 3%, to $3.7 billion.

Google's paid clicks -- the number of ad clicks or views on which the company recorded revenue -- rose 29% annually for the second quarter in a row. Paid clicks on Google sites rose an impressive 37% thanks to strong mobile search and YouTube ad growth; paid clicks for network sites were flat.

A shift toward mobile search and YouTube ads is still coming at the cost of lower ad prices: Cost per click fell 7%, courtesy of a 9% drop on Google sites and an 8% drop on network sites. But it only fell 1% sequentially, and the annual drop is better than the first quarter's 9% and the fourth quarter's 13%.

Restrained spending under CFO Ruth Porat remains the other big driver of Alphabet's strong financial performance. Adjusted operating expenses rose 15% annually, easily trailing revenue growth of 21%. And capital expenditures fell 16%, to $2.1 billion, which (along with revenue growth) helped free cash flow rise 53%, to $7 billion. Capex will probably start rising again soon, given Google's infrastructure needs, but for now it's a major tailwind.

"There's a story where basically the revenue went up, the expenses went down dramatically -- that was really really fabulous," said Jim Cramer, TheStreet's founder and manager of the Action Alerts PLUS portfolio, which owns Alphabet.

Google's strong ad growth wouldn't be possible if not for the investments it has made to make sure its search services remain a valuable utility to consumers in an app-dominated smartphone landscape. Those efforts include optimizing results based on location and device type, indexing the content of mobile apps and even (through its AMP initiative) improving the performance of third-party mobile web pages. Many of those efforts leverage Google's unmatched search data and machine learning algorithms; on the earnings call, Google chief Sundar Pichai said over 100 Google teams are using machine learning.

The growth also wouldn't be possible without improvements made to Google's core AdWords search ad platform. Over the past year, the changes have included creating more effective shopping and travel ad formats, letting mobile users pay for advertised items on Google's site, supporting larger ad headlines and descriptions, allowing ads to be customized based on location and providing a better interface for marketers running AdWords campaigns.

One weak spot in the second-quarter report: Traffic acquisition costs rose as a percentage of revenue for both Google sites and network ad sales. That was attributed to mobile search growth -- Google is believed to make considerable payments to Apple (AAPL - Get Report) for the right to be the default search engine for Mobile Safari, and lesser payments to carriers and Android manufacturers -- and growing adoption of programmatic (automated) ad-buying platforms by advertisers.

Also, Alphabet's "Other Bets" reporting segment, which covers businesses such as Google Fiber, the Nest/Dropcam smart home unit, the Calico anti-aging drug unit, and Alphabet's self-driving car efforts, reported an $859 million operating loss, up 30% annually. Revenue, much of which is believed to come from Nest/Dropcam, rose 150%, but still only amounted to $185 million.

But for now, markets are willing to give Alphabet a pass for the losses incurred by Other Bets' long-term projects. At least while Google's core business keeps defying the law of large numbers and making mobile monetization fears look quite misplaced.

On Friday morning, Alphabet shares were trading up 3.9% to $795.64.