It is probably designed to prevent your device from powering off.
If a battery cannot provide enough current to the processor, screen and the other active hardware it can cause the device to shutdown unexpectedly, potentially causing data loss (if it was in the middle of doing something). If Wi-Fi, Cellular, Bluetooth, camera are all active that can be a substantial load on a battery, add the flash LED's & other circuitry it may be more than the battery can provide at that moment.
This may occur if you are in cold conditions as batteries can perform poorly under low temperatures.
Next time it happens grab a screenshot of the dialog & consider taking it along to an Apple store if you need help or a better explanation. They may be able to test the battery to see if it is in good condition.
You also have to consider that certain live effects or photograph styles may require more processing - so if you take a 'portrait mode' photo (which uses 3d depth mapping and filters) it may add to the CPU/ Graphics processor load, requiring more power.