There are many reasons a hard drive or usb pen can fail, and the same is said for phones and tablets. They ccan all loose their data or fail in some way that cuases loss of data.
Hard drives often have to be dissmantalled and put into special machines that read the metal discs and slowly read all the data. The are normally 2 metal discs inside drive, and when removing then care must be taken to keep them perfectly traight in their original alignment right up to the point when they are sucred into the recovery machine.
This slightest miss alignment means total loss off data as there is no way to correctly realign the discs, and they wont have their cylinders lined up. Each cylinder passes through from the top down through every side top and under of both disks.
Mobile phones and tablets can hold SD memory cards which can also fail, but the worst failure would be the device itself, becuase if that breaks you can't get to the internal memory to get back youre pictures or music. In this case the device has to be taken apart and then the Emmc memory chip found and carefuly removed from devices motherboard. This chip is then cleaned and then solder pads resoldered. The chip is then put in a machine that helps recover data from it...