They are classic “frienemies,” collaborating when the interest is mutual and going for the other’s jugular when the opportunity presents itself. So it was that on Monday Apple made clear that it’s willing to cut ties with Google if that’s what it takes to move its own agenda forward.

Among the product and technology announcements made at its annual developer conference here, Apple said it is expanding its Siri voice assistant software, as well as offering a complete rewrite of its maps app. Apple also added deep integration to Facebook to its phones and tablets. If it all works out as Apple wants, the net effect will be to extend Apple’s lead at Google’s expense. Here’s how:

Perhaps nowhere is this more apparent than in regard to the new version of Maps for iOS. Apple yanked Google maps from all its mobile devices, and took that function in house.

The results were striking. A new 3D feature lets users swoop around cities and see buildings using photography Apple captured on its own. Google demoed what was essentially the same thing in detail during a press conference last week, with a pledge to bring it to iOS later this year.

The move is just part of a larger effort by Apple to differentiate its mobile OS from Google’s at a time when the two companies are at war with each other for the pockets, and pocketbooks, of consumers. That clash began on store shelves when the two companies started competing in the mobile-device arena. It has since spilled out into courtrooms, with Apple attacking Android device makers along with patents related to Android features.

Where this can really hurt Google is in the flow of information. Information about areas people are searching for and what types of information they want is absolute gold when it comes to product development and advertising. Apple happens to have its hands in both of those pots, and now it doesn’t have to share data with a rival.

Apple is also doing something different by positioning its mapping app as a marketplace of sorts. During today’s keynote, the company said it will feature location apps made by other companies right through the app — though that simply could have been a concession to roadkill it made out of the other GPS apps for the platform.

The we-can-do-better-than-Google theme began almost immediately, with a demo of Siri that opened up the conference. The sassy voice assistant made cracks about Google and its products before the company’s executives even took to the stage.

“Hey, any of you guys been working with ICS (Ice Cream Sandwich) or Jelly Bean?” the software asked in a prerecorded video that started the show. “Who’s working up these code names? Ben & Jerry?”

Apple made it clear it wants to transform Siri into something far more than an iPhone app. That starts with Siri for Apple’s third-generation iPad, and will extend to cars within the next 12 months. Several automakers, including BMW, General Motors, and Honda, have signed up and will integrate Siri into steering wheels. This competes more with the Microsoft Sync technology, which is built into some automobiles. But in the way Apple is currently demoing it, everything will run through your iPhone, something that competes more directly with Android’s special car mode.

Put simply, Siri is becoming Apple’s search engine. It may send users to Google or Microsoft’s Bing for some queries, but the idea is the same: It’s taking user queries and directing them toward something. Today that functionality expanded to new types of information, like movie times, restaurants, and sports. Arguably, those are three things users might have turned to Google for, and no longer have to. Other features, like being able to launch apps, were catch-ups to features Google has had on Android.

Name-calling goes only so far, which is why Apple made an effort to point out that its strategy of selling a more limited group of iOS-capable hardware (the iPhone, iPad, and iPod Touch) resulted in more users staying up to date, compared with people using rival mobile devices.

“Almost all of our users are running iOS 5,” Apple’s senior vice president of iOS, Scott Forstall, told developers, while standing in front of a large pie chart. “Now if you compare that to the competition, they released dairy product 4.0 about the same time we released iOS 5.”

That played well to the audience of developers for a good reason: with more users on the same OS, it makes developing easier. There’s no reason to produce multiple versions of the same app, with only certain features available to specific users — something Apple has harped on Google for in the past, specifically with tablet apps.

In March, for instance, Apple CEO Tim Cook slammed Android’s tablet efforts, calling a number of third-party Android applications shoddy.

“It kind of looks like a blown-up smartphone app,” Cook said, while pointing to an on-screen example of Twitter’s Android app. “Because that’s exactly what it is.”

Today that message came back around in terms of the number of apps available to consumers, which now stands at 650,000 on the App Store, with 225,000 of those made for the iPad. And perhaps more importantly, the payout: Apple’s paid out more than $5 billion to developers since launching the App Store, Cook said.

Apple’s move to integrate Facebook into iOS isn’t a direct hit at Google, but it unites two companies against a common enemy. The new features let iOS 6 users post right to Facebook from within apps, as well as sync up their Facebook lives to their phone. Things like contacts and calendars get automatically ferried between the two companies.

Apple also integrated Facebook into iTunes and the App Store. This is more promotional than anything, but it’s also a strong sign that besides Twitter, Facebook will be the only social network Apple is giving users to promote its content.

“We believe the biggest takeaway is that Apple is strengthening not only the interaction within its own ecosystem but also creating a consortium of powerful Web partners to offer an experience that largely falls outside of Google’s walls,” Piper Jaffray’s Gene Munster said in a note to investors today. “We believe this focus on integrating important Web partners continues to meaningfully differentiate iOS from Android.”

In other words, the real move here is in just how many places Facebook is present in iOS 6, and in the upcoming version of Apple’s desktop OS. The idea is that if you want to share anything, you can do it basically from anywhere. For a company that was once determined to keep app developers within the confines of its mobile Web browser, it’s arguably just as big to let others into similarly hallowed ground.

At this stage, Apple still prefers to talk around the hard edges. But make no mistake: Tweaking Google to get a few laughs out of the crowd hinted at the bigger stakes in this competition. For Apple, a roll of the dice is well worth the risk. In a race with Google to see who can get out the better technology first, Apple believes it has grabbed post position. Game on.