My Nexus 5X now stays on for a lot less time after I get a low battery warning than when it was new.
The voltage written on a standard battery cell is the "average" voltage the cell will produce across its life time.
As amperage is spent(?), the voltage will drop slightly, so the cell will start out higher than listed and end lower than listed.
What is likely happening is that the when a certain app is started, various parts of the hardware is clocked up to handle the work load. This result in a higher draw, and a sharp drop in the measured voltage, in turn the power management logic considers the battery nearly drained and shut down.
Never mind that unlike older battery chemistry, lithium batteries do not take kindly to being fully drained. Thus there will be a programmed safety margin involved.