Meditation and good deeds vs clarity of mind during death How important is meditation practice and doing good deeds in comparison to having a clear mind during death in order to reach nibbana or be at least reborn in a good realm?

For example, if one meditates daily almost his whole life and does good deeds but then dies in a car accident, overwhelmed by the fear and the shock of this event, what are the chances of a good rebirth for this person? In other words: Is the quality of rebirth determined only be the state of mind during death or is it also influenced by karma which one has accumulated during his life?

It also gets maybe a little tricky, since people with near-death experiences report having a flash of all events in their life in addition to getting information about the impact their deeds had on their own and other people's minds.
Ultimately, the moment of death consciousness is all that counts. That consciousness, however, is of course partially conditioned by all the good and bad deeds one has performed in the past, especially since one's life tends to flash before one's eyes just before that last moment, leading one to often cling to this or that memory or idea.

Technically, there are four potential types of karma that determine the nature of the last moment of one's life (Vism XIX.15):


garu-kamma (weighty karma) - if one has killed one's mother or father, for example. These types of karma outweigh any other possible result; one who has performed these at some time in this life cannot help but go to hell in their next existence.
bahula-kamma (frequent karma) - if one has performed a certain karma with great frequency, this will be the next candidate for adherence at the moment of death.
aasanna-kamma (dying karma) - if there is no particular karma that stands out as habitual, the most likely single karma to cause rebirth is karma performed at the moment of death, for example getting angry or upset, crying or clinging to something, or listening to the dhamma or meditating.
kattata-kamma (merely performed karma) - finally, the last karma to lead to rebirth is some karma that comes to mind at the moment of death, even at random.


Of course, besides the first of the four, one's state of mind at the moment of death can potentially nullify all karma and even lead one to not be reborn again. The point is that, regardless of what colours it, it is that last moment that leads to rebirth (or nibbana).

This is exemplified by the interesting story of Queen Mallika (Dhp-A 151), who was a devoted Buddhist who performed great acts of charity and morality, but died remembering a single act of deception towards her husband and therefore went to hell. After spending seven days in hell, she died again and was reborn in heaven due to her good deeds. Perhaps this also suggests that one's rebirth itself isn't as important as one's karma, since it will all generally work its way out in the end.