"When the tine of death arrived for the foolish Ajamila, he began thinking exclusively of his son Narayana."
The highest perfection of human life, achieved either by complete knowledge of matter and spirit, by acquirement of mystic powers, or by perfect discharge of one's occupational duty, is to remember the Personality of Godhead at the end of life.
Somehow or other Ajamila consciously or unconsciously chanted the name of Narayana at the time of death and therefore he became all-perfect simply by concentrating his mind on the name of Narayana.