Some Apps, while running, can disable auto-lock. In such situations, the iPad will remain turned-on and active, draining the battery until the battery is depleted, at which point the iPad will shut-down to protect the battery from deep discharge.
You'll need to identify the App that was running at the time; there may an App settings that controls this behaviour. If not, you must remember to quit the App when you are finished using it, or keep the iPad connected to its Power Adapter to prevent the battery from being fully drained.
Apps that employ this behaviour are typically video playback, recording Apps, or Apps that log and record activity.