It's supposed to hit "zero" (which is actually a bit above true empty) and go into safe sleep, where memory will be preserved if it really does hit empty. If the battery calibration is off, or if the battery health is abnormal, it may not have time to write all the memory to disk before the battery really runs out, in which case it turns off from loss of power and you lose things.