Why does my iPhone power off when the battery is down to 30%?
This is usually for one of three reasons:


Aging battery. Lithium ion cells chemically age and peak power output decreases as does total charge available to supply at various voltage levels. 
Abnormal or failed / out of tolerance battery. Same as above, but the voltage and current is below spec for the battery age. 
Bad calibration or hardware. I've never seen that be 30% off, though. After the battery is drained completely, charge the phone back to 100% completely (and for good measure, leave it on the charger for another hour or two). An iPhone can draw more power than a perfect battery can provide due to defect or damage. It might not be the battery.