Rewind two months: the United States government gets a judge in California to order Apple to help the FBI unlock the San Bernardino shooter’s iPhone 5c. Apple refuses, citing worldwide privacy concerns. A month later, the government withdraws the court order and sweeps the ordeal under one of its many rugs.

In plain English, Apple beat the government. The U.S. government.

Which leaves us wondering:

How?

Scores of these court cases remain sealed and behind closed doors. For quite some time, Apple complied when the government asked it to extract data from iPhones: Apple had the means to do so, and, the government would argue, it therefore had to. But each new government request was driving Apple further and further up the figurative wall.

So it ramped up its security. As time wore on, Apple engineers introduced a workaround: they’d make future iOS versions impenetrable. For iOS 8s and 9s, even the engineers were locked out. They’d be able to comply with basic government requests, but the meat of phone data would be inaccessible. When the government next came knocking at the back door, there’d be no one to answer.

Naturally, the government and intelligence communities went apeshit. But neither the public nor lawmakers seemed to bristle. Encryption was having a moment. Security agencies, meanwhile, seethed.

In fact, those agencies did more than just seethe. In September, 2015, just over two months before the San Bernardino attacks, someone leaked an email to the Washington Post. This email came from Robert S. Litt — the “intelligence community’s top lawyer” — and went out to his associates. In the email, Litt admitted that the public and “legislative environment” around encryption was “very hostile.” However, he continued, “it could turn in the event of a terrorist attack or criminal event where strong encryption can be shown to have hindered law enforcement” — and it’d be wise, Litt said, to keep “our options open for such a situation.”

On December 2, 2015, Syed Farook and Tashfeen Malik gave intelligence officials that opportunity. But it took a few more months for those officials to find their way in. The solution presented itself in the form of an iPhone 5c: Farook’s work phone, which he had left inside his mother’s black Lexus. Beginning in late January and lasting about a month, as the court docket illustrates, the government went about sealing and unsealing — making private and public — various documents.

And then, on February 16, 2016, the government — via Magistrate Sheri Pym — compelled Apple to assist in unlocking Farook’s iPhone. The government simultaneously brought the story to the media’s attention. Atypically, there was no motion to seal this court order: the government wanted the public to know. And there, then, began the war for precedent. It was a government gamble, a wager that the gravity of this case would sway the public once and for all against strong encryption — and, importantly, against Apple.

At the time, it must’ve seemed a good wager. It was a high-profile terrorism case on American soil; accessing the data on the phone in question was critical to national security (so long as no one asked too many questions about it). And yet this wager spectacularly backfired. The end result of this wager was that the government, in effect, backed away whimpering, with its tail between its legs. Sure, the government purportedly accomplished its mission and, by way of an undisclosed outside party, accessed the phone’s data. (The data yielded nothing of import.)

Perhaps one can now say that the public’s stance on encryption is more staunch than the government was willing to believe. Whatever the cause, the effect was clear: the government did not wager well; people literally took to the cold, rainy, streets to support Apple’s cause as a proxy for privacy rights.

The American people raised and said: Whoa, Nellie. It was as if, for a moment, some rationality still circulated within our borders.

Apple stepped away from the particulars and looked at the big picture

Apple saw this case as an opportunity to keep the back door locked, and that’s just how it played out. CEO Tim Cook has long advocated for the maintenance of that lock, and long butted heads with government officials over this contentious issue. It’s no surprise that Apple went to bat, and did so quickly. What is surprising, and what’s commendable, is that Apple did not bite at the specifics of the case. A paradigm of wisdom, Apple stepped away from the particulars and looked at the big picture: what would we be sacrificing if we gave in to this government pressure? The answer, to Apple, was unacceptable. And so it remained steadfast. Once other tech companies got wind that Apple was actually going to succeed, they jumped on the bandwagon.

And, with that, Apple put the U.S. government in its place.

The next time the government yearns to gamble, it should remember that a full house beats a flush.