It doesn't. Changing the OS allows removal of the anti-bruteforcing feature(s): the delay between attempts that increase exponentially, or the delay limit of 10 where the encryption key(s) are deleted and in effect all user data. This may not be possible on iPhones with secure enclave though, the anti-bruteforcing is in part built into the secure enclave, but the iPhone 5c in question in this case doesn't have a secure enclave so it might be possible. And further they want an automated way to iterate the password. Basically they want a backdoor to make it easier to bruteforce the phone through guessing the passphrase.
So there is nothing for Apple to hand over. There are no actual keys (they're on the phone itself in an unaccessible way, practically). The court order in effect orders them to write a derivative OS without bruteforce inhibition features. They probably can do that, it probably isn't burdensome, but is it legal to compel a company to write code? Can a court order you to write a book? Or a letter? They can make you turn over facts or evidence, but it's specious they can make you create something, even if you have the capacity to create it.
So there is nothing for Apple to hand over. There are no actual keys (they're on the phone itself in an unaccessible way, practically). The court order in effect orders them to write a derivative OS without bruteforce inhibition features. They probably can do that, it probably isn't burdensome, but is it legal to compel a company to write code? Can a court order you to write a book? Or a letter? They can make you turn over facts or evidence, but it's specious they can make you create something, even if you have the capacity to create it.