I have just been talking to the Apple helpline. If you inherit from a deceased relative their ipad/iphone and you want to factory reset it you are, simply, out of luck. All devices are locked to icloud accounts and it is very hard to impossible to remove them. This is normally a good thing — you can basically destroy the hardware and if the tech gets it back or you get a new device everything transfers over.
But in the event of a relative deceasing, not a good thing. Apple will require that you provide a copy of the death certificate. They will then remove that icloud account, and help reset the device.