In the end, it was a case of being in the right place at the right time for Waze – driving serenely through a “sweet spot” into which two of the world’s Internet giants, Facebook and Google, are keen on expanding.

Waze got there with the hard work of its development team, the creators of the much-loved Israeli-born-and-raised app that uses crowdsourcing to beat traffic. On Tuesday, the news arrived that proved just how that hard work has paid off, with Google and Waze mutually announcing that the Israeli company had sold itself to the search engine giant for $1.1 billion.

Facebook and Google, Waze’s two suitors, worked feverishly to make the Israeli company an offer it couldn’t refuse. In Waze, each found something unique that would push forward their own interests; for Facebook, Waze was an app that would give it an instant social network geared to drivers, opening up new advertising possibilities. For Google, Waze offers a chance to beef up its own social network — and deny its competitor a gem that could have posed a real challenge in the future.

Google won, buying Waze for $1 billion in cash, with an additional $100 million in performance payouts in cash and Google stock for employees, company sources said. “Of course we’re all celebrating now,” said a Waze employee who spoke anonymously. “In many buyouts, the workers get either nothing, or shares in companies that they aren’t familiar with, and can’t really gauge the value of. But everyone knows Google, and knows that they are very lucky to have on opportunity to have a share in their success.”

Rumors that Google was interested in buying Waze surfaced several weeks ago, after reports that a deal between Waze and Facebook had broken down over Facebook’s insistence that the Waze team relocate to one of its existing R&D facilities in Europe or the US.

Waze’s leadership reportedly insisted on remaining in Israel. In an interview several years ago, Waze co-founder and President Uri Levine said that the company is very proud of its Israeli roots, and that he did not foresee moving anywhere.

While some cynics downplayed the issue of location as a reason for Waze to allow the deal with Facebook to fall apart, the final price tag to be paid by Google is not hugely different.

The difference between the two offers was in the “extras,” in Google’s willingness to allow Waze to retain its independence, and its Israeli identity. In a blog post officially announcing the deal Tuesday, Google Vice President Brian McClendon said that “the Waze product development team will remain in Israel and operate separately for now.” Google already has numerous development teams in Israel, so Waze will fit right in with the company’s operations.

Google already has a traffic and mapping application, but it hasn’t taken off to the extent Waze has. In his blog post, McClendon said he hoped that would change. “We’re excited about the prospect of enhancing Google Maps with some of the traffic update features provided by Waze and enhancing Waze with Google’s search capabilities,” McClendon wrote, adding that Google will “also work closely with the vibrant Waze community, who are the DNA of this app, to ensure they have what’s needed to grow and prosper.”

Google, of course, has the resources to further develop its own mapping app. Although Waze’s 50 million users will help beef up Google Maps, many analysts believe that Google’s motivation in buying Waze was not to improve its own app, but to deny Facebook a prize that could have enhanced competition in the social network sphere.

Waze’s users are a highly desirable demographic — car owners who have disposable income — and would have helped Facebook position itself as a social media network appropriate for adults, as well as teenagers. Plus, Facebook would have an instant inroad into mobile social media, with its attendant advertising opportunities, including ads beamed at drivers as they move through different areas. Waze has a well-developed location-based advertising engine doing just this, and the Google move denies Facebook a powerful arrow the social network would have been glad to add to its quiver.

The Google “play” against Facebook has been noticed by regulators, according to a report in The Marker Tuesday. The report quoted European regulators as demanding “guarantees” that Google will not add Waze’s user information to its own user database, but rather keep the two services separate — a hot-button concern in the wake of news that Google cooperated with the National Security Administration in the US, allowing the NSA liberal access to data as a part of the Prism project.

Google already has enough data on everyone, the regulators said, and doesn’t need more. In the US, indeed, some critics are calling on the Department of Justice to put a stop to the deal, as it will give Google even greater domination in the mobile services area.

But Google’s purchase isn’t just a negative play against Facebook; it’s also an offensive move by the search engine giant against the world’s largest social network. Google has its own social network, called Google Plus, which is seeking traction in a Facebook-dominated world. Google Plus has about 350 million active users, versus Facebook’s 700 million active users (and over 1 billion accounts). Google Plus has been considered a dark horse in the social networking sphere, but it’s a fast moving horse; Google started the service in September 2011, and it has quickly grown to be the world’s second-largest social network. Integrating Waze’s loyal user base into Google Plus could provide the social network with the features, and the boost, it needs to up its user base.

As far as Waze is concerned, the deal saves the company the “trouble” of going public. Writing in his own blog post announcing the deal, Waze CEO Noam Bardin noted that “choosing the path of an IPO often shifts attention to bankers, lawyers and the happiness of Wall Street, and we decided we’d rather spend our time with you, the Waze community. Google is committed to help us achieve our common goal and provide us with the independence and resources we need to succeed. We evaluated many options and believe Google is the best partner for Waze, our map editors, area managers, champs and nearly 50 million Wazers globally.

“Together, we can accelerate our mission to outsmart traffic. We will continue to make a real impact on drivers globally, helping them save time and money while making everyone’s daily commute a bit more efficient and fun,” Bardin wrote.

Either way, Israelis can be proud that one of the most innovative mobile apps, developed right here, is fetching the largest amount of money ever for a consumer-oriented service, Prime Minister Benjamin Netanyahu said. In a phone call Tuesday, Netanyahu wished Bardin a “mazal tov” and a “mabrouk,” the Arabic term for congratulations. “You reached the goal,” Netanyahu said, “placing Israeli technology at the center of the world’s attention.”

The Waze sale provides another benefit, aside from national pride, the prime minister told Bardin. “You are contributing a great deal to the country financially” by the fact that a billion dollars would soon be brought into the country — with the attendant tax that will be paid on the sale, of course. “Under current circumstances, that’s a very big deal,” Netanyahu added.