A federal judge has ordered a defiant Apple to help the FBI crack a secure iPhone that belonged to one of the shooters in the San Bernardino attack.

What's going on in this showdown between the U.S. government and one of America's most powerful and popular companies?

Apple Takes Itself Out of the Loop

The immediate cause for the confrontation between Apple and the FBI started in 2014, when Apple released iOS 8. The update for the iPhone's operating system put a priority on privacy and user data safety, beefing up passcode security and encrypting data on the device by default.

Apple's encryption measures are a reflection of the company's current top-line priority on user security, but also a self-conscious response to government surveillance and the legal power of its apparatuses to compel information from technology companies.

That's because Apple effectively took itself out of the loop, putting up a firewall against legal pressure. As Ars Technica noted, on Apple's iOS 8 website at the time the company stated, "Unlike our competitors, Apple cannot bypass your passcode and therefore cannot access this data."

A New Loophole for Backdoors

The iPhone 5c that the FBI recovered from one of the shooters was encrypted and locked, and the agency wanted Apple's help. It asked Apple to make a new version of iOS that could be installed on the phone. This custom iOS would allow the FBI to bypass the security measures, which the company believes is another word for a "backdoor" to encryption.

Obviously, given its stance on security since iOS 8, Apple hasn't been helpful. So on Tuesday, a federal judge in California ordered Apple to help the FBI unlock and decrypt the iPhone.

Apple CEO Tim Cook responded late Tuesday with a public letter posted on the company's website. In it, he addresses the court order, arguing Apple's case for no backdoors to encryption.

"Up to this point, we have done everything that is both within our power and within the law to help" the FBI, stated Cook. "But now the U.S. government has asked us for something we simply do not have, and something we consider too dangerous to create," he continued, referring to the custom encryption-bypassing version of iOS Apple was asked to create.

"In the wrong hands, this software -- which does not exist today -- would have the potential to unlock any iPhone in someone's physical possession. The FBI may use different words to describe this tool, but make no mistake: Building a version of iOS that bypasses security in this way would undeniably create a backdoor," he wrote, rather forcefully for Cook's personality.

A Very Old Loophole for Backdoors

Cook later explained Apple's legal stance towards the court order. "We can find no precedent for an American company being forced to expose its customers to a greater risk of attack," he wrote.

Apple has been arguing that creating the special version of iOS is like opening Pandora's Box. If a brute-force bypass were to exist, there's no guarantee that even in the FBI's hands, such a powerful digital weapon would be absolutely secure forever. If it were to slip onto the Internet, the software would destroy all of Apple's security measures, and could destroy the company. "We are challenging the FBI's demands with the deepest respect for American democracy and a love for our country," said Cook.

Apple is suggesting updating a 225-year-old law called the All Writs Act, which the judge cited in her mandate that Apple create a backdoor to its security. In Magistrate Judge Sheri Pym's 40-page filing, Pym cited the 18th century writ, which allows courts to issue a writ, or order, to compel a person (or in this case, a corporate "person") to do, basically, anything.

It lets judges "issue all writs necessary or appropriate in aid of their respective jurisdictions and agreeable to the usages and principles of law," to put it literally, if still nonspecifically.

What's Next?

The government has used that writ against tech companies before, but this is Apple, the richest company in history.

And Apple is pushing back. The New York Times is saying this confrontation might end up in front of the Supreme Court -- whoever may be sitting on the bench when that happens. But that's up to an entirely different high profile showdown.