Your iPhone keeps turning off because iOS deliberately cuts power when a monitored condition crosses a safety limit: battery voltage sag under load, internal heat, a loose power path, or a software watchdog fault. Most random shutdowns trace to the battery's ability to deliver current, not to malware or a "bad update." The shutdown is a protection event, not a crash.

Shutdown mechanism: voltage sag and the power management unit

A lithium-ion battery does not fail like a light switch. It degrades gradually, and its internal resistance rises as it ages and as charge drops. That resistance causes voltage to sag when the processor suddenly draws a burst of current.

Apple's power management unit (PMU) constantly samples battery voltage and current. When a load spike pushes voltage below a floor the PMU considers safe, it commands an immediate power-off. The phone cannot tell you "the battery is weak under load." It can only shut down.

This is why shutdowns cluster in predictable moments. Camera launches, gaming, GPS navigation, and cold weather all raise current draw or lower baseline voltage. A phone that idles at 40 percent happily can die instantly at 40 percent the moment you open the camera. The gauge and the shutdown disagree because they measure different things: state of charge versus deliverable power.

One layer deeper is the fuel gauge itself. iOS estimates remaining charge from coulomb counting and voltage curves. As a battery ages, that model drifts. The phone may believe it has 30 percent left when the cells can no longer sustain a load spike. The result looks like a random shutdown but is a modeling error meeting a hardware limit.

Plain language: the phone isn't running out of charge. It's failing to deliver charge fast enough, and the system shuts down rather than risk corrupted writes.

Quantified context: how often, how old, how hot

Lithium-ion chemistry loses capacity with every full cycle. Apple rates iPhone batteries for roughly 500 complete charge cycles before capacity falls to about 80 percent of original. A typical user completes a cycle every one to two days, so meaningful degradation usually appears between 18 and 30 months.

Internal resistance roughly doubles by the time a battery reaches end of life. That doubling is the mechanism behind voltage sag: the same current burst produces a larger voltage drop. Shutdowns under load become far more likely in year two to three than in year one.

Heat accelerates everything. Apple specifies iPhone operation from 32°F to 95°F (0°C to 35°C). Above 95°F, the system throttles and may shut down to protect the battery. Below freezing, lithium-ion electrolytes slow and voltage sags sharply, which is why winter outdoor use triggers shutdowns even on healthy phones.

Time is the other variable. Even a lightly used battery ages chemically. A phone left at 100 percent charge in a hot car degrades faster than one stored at 50 percent in a cool drawer. Age and heat compound.

Edge cases: when the shutdown isn't the battery

Not every power-off is a protection event. Some are faults.

Charging port debris: lint packed into the Lightning or USB-C port blocks contact, causing intermittent power and reboot loops. Swollen battery: a physically expanding cell can press on connectors or the display, causing sudden shutdowns and a safety hazard. Water exposure: liquid can bridge contacts and trigger shutdowns days after the event. Faulty power button or flex cable: a shorted button can command shutdowns or boot loops. Corrupted iOS install: a failed update can leave a watchdog that reboots the phone under specific conditions.

A counterintuitive caveat professionals know: a phone that shuts down at high charge percentage is more suspicious than one that shuts down at low percentage. Shutdown near 1 to 5 percent is normal behavior. Shutdown at 40 to 60 percent points to voltage sag or a hardware fault, not ordinary depletion.

Another edge case is the "boot loop" versus the "shutdown." A boot loop restarts repeatedly and never reaches the home screen. A shutdown powers off and stays off until you press the button. They have different causes and different fixes.

Misconceptions: malware, updates, and "battery memory"

Malware almost never causes iPhone shutdowns. iOS sandboxes apps tightly, and a malicious app cannot command system power-off. If someone tells you a "virus" is turning your phone off, the diagnosis is wrong.

Software updates are a common scapegoat. An update can change power management behavior temporarily while the system reindexes files, which raises heat and current draw for a day or two. That is a transient effect, not a permanent defect. Persistent shutdowns after an update usually reflect an underlying battery or thermal issue the update merely exposed.

"Battery memory" is a legacy nickel-cadmium concept that does not apply to lithium-ion. Fully draining your iPhone to "recalibrate" the battery does not fix voltage sag and can stress the cells. The modern equivalent is a one-time full discharge to recalibrate the gauge estimate, not the cells.

A fourth misconception: replacing the battery fixes every shutdown. It fixes most, but not loose connectors, swollen cells already damaging the chassis, or logic-board faults. Diagnosis matters more than parts.

Practical actions: how to isolate and fix it

Work from cheapest and safest to most invasive.

Check Battery Health. Open Settings, then Battery, then Battery Health & Charging. If Maximum Capacity is below 80 percent, or if you see a "Service Recommended" message, the battery is the leading suspect. Reproduce the trigger. Note what you were doing at each shutdown: camera, gaming, cold outdoor use, charging. Patterns narrow the cause. Rule out heat and cold. Avoid direct sun and hot cars. If shutdowns only happen outdoors in winter, cold-induced voltage sag is likely. Clean the charging port. Power off, inspect with a light, and gently remove lint with a non-metallic tool. Do not use compressed air at close range. Update iOS once. Install the latest version, then observe for 48 hours before concluding the update caused anything. Back up and restore as a last software step. A clean restore separates software corruption from hardware fault.

Replace the battery when Health shows below 80 percent or when shutdowns at mid-charge persist after cleaning and updating. Use a reputable service; an unauthorized battery can bypass thermal protections and void coverage.

Red-flag warnings:

A swollen battery, bulging screen, or case separation is a fire risk. Stop using the phone and have it serviced immediately. Shutdowns accompanied by extreme heat, odor, or discoloration warrant professional inspection, not DIY repair. Repeated boot loops after a restore can indicate logic-board failure and need authorized service. Never puncture, bend, or press on a swollen battery.

Timeline: what a shutdown event looks like

Stage What happens Time scale
Load spike Camera, game, or GPS draws a current burst Milliseconds
Voltage sag Internal resistance drops terminal voltage Milliseconds to seconds
PMU decision Voltage crosses floor; power-off commanded Under a second
Shutdown Screen blanks; writes are halted 1 to 5 seconds
Restart Device boots and recalculates charge estimate 20 to 60 seconds
Gauge drift Estimate diverges further from true deliverable power Days to weeks
Degradation Capacity falls; resistance rises Months

The table shows why the event feels instantaneous: the decision happens in under a second, but the cause builds over months.

Comparison: shutdown cause versus signature

Cause Typical charge level at shutdown Trigger pattern Best next step
Aged battery (voltage sag) 20 to 60 percent Camera, gaming, cold Check Battery Health; replace if below 80 percent
Thermal protection Any level Direct sun, heavy load, charging Cool device; avoid heat
Cold-induced sag 30 to 70 percent Outdoor winter use Warm the phone; expect seasonal pattern
Charging port debris Any level While charging or moving cable Clean port; inspect cable
Swollen battery Any level Shutdowns plus physical bulge Stop use; professional service
Software corruption Any level After update or restore Restore iOS; observe 48 hours

Limitations: what this cannot tell you

This explainer describes mechanisms, not your specific device. It cannot diagnose a particular phone's fault, prescribe a repair, or guarantee a battery replacement resolves every shutdown. Battery Health percentages are estimates, not measurements, and can mislead on recently serviced devices.

Some shutdowns have causes outside this framework, including liquid damage that surfaces later, logic-board micro-fractures, and rare manufacturing defects. If shutdowns persist after a battery replacement and a clean restore, authorized service diagnostics are the correct next step.

This article is general educational information, not a diagnosis, repair plan, or safety certification. Do not attempt to open, puncture, or service a swollen battery yourself. For a device that is hot, swollen, smoking, or damaged, stop using it and contact Apple Support or a qualified repair professional; for immediate fire or injury risk, contact local emergency services.