None of us know but the most possible answer is that after you die your brain goes through the most activity that it has ever been in and you start going through the most peaceful state of your life(You basically reflect through your best memories and stuff)And than after the spike in activity your brain shuts down making you officially die, usually your hearing is the last to go
(This is the scientific version btw)