what could cause a sudden drop in battery life? According to my battery graph the phone went from 85% to 0 in an instant. I wanted to add a screenshot, but I do not have enough reputation. The last time I checked it was nearly full, and 7 hours later in the morning it was empty. At home I charged it until it showed 29 percent, but by the time  I got to the office, it was 32.

How can this be? How can I prevent it in the future?

LG P990, Android 4.0
It could be a misbehaving app keeping the device awake; I have that about once a month with my Motorola Milestone 2. Did not figure out how to prevent it, but a reboot always solved it.

A proposal how to "catch" it, however: There's an app called DrainGuard available on the playstore. It watches your battery consumption, and gives an alert as soon as it detects a "sudden drop". This helps to notice the "power drain" before the "5% alert" makes a noise and switches your phone off -- so you can either start investigating while the process is ongoing (some time left before "full drain"), or simply trigger an immediate reboot to "kick the bad guy out" when in a hurry.