It is illegal to intentionally destroy something that you suspect could be evidence in a future criminal case against you. Say you operate an illegal drug network from a specific phone that you've intentionally setup to self-destruct at reboot. Both you and the cops know there is likely evidence on there that would implicate you. Then, if you either intentionally reboot the phone or maybe the battery dies while in police custody before they can access it and the phone is wiped, you could be liable for destruction of evidence. However, if it's just a standard smartphone and you accidentally drop it in the toilet, unintentionally destroying all evidence, you may not be liable.
Basically, if you intentionally destroy evidence, either actively passively, you're liable.
It is kind of a broad law and is difficult to prosecute in many cases. The cops have to know that you did the crime and prove that the evidence existed. If you murdered someone and made it look like a suicide, the cops would have to not only suspect you but also know that you left fingerprints and DNA behind that are no longer present.