If your iPhone's battery can't keep up with what you're doing or you overwhelm its hardware, it might shut down to protect itself.