When a person dies their estate goes through probabte. You get official documents as a result. That documentarion is effectively a court order - they are good enough to get banks to release funds from the dead person's account to the executor of the will.
Apple sometimes do not recognise those documents and refuse to unlock devices that used to belong to dead people, even if the device is mentioned in the dead person's will.
http://www.bbc.co.uk/news/technology-26448158
Here they're not asking for access to the information - they just want the device to be unlocked. Apple recognised, after publication, that they'd made an error in this case, but they maintain that a court order is required for access to iCloud accounts. But they don't recognise grants of probate as valid court orders.