Alarka is the youngest among the four sons born of the womb of Kuvalāśva (Kuvalaswa) and Madālasā (Madalasa). The other sons of Madālasā were disinterested in Rājadharma (Rajadharma; duty of a king)and Saṃsāradharma (Samsaradharma; duty of a householder). So, as per the request of Kuvalāśva, Madālasā adviced Alarka regarding the responsibilities of an ideal householder and king. Thus instructed by his mother, Alarka started functioning as a proper Kṣatriya. He got his father’s kingdom as inheritance, and ruled the subjects for a long time. Madālasā instructed her son in capacity of a king —
vatsa rājyehabhiṣikte prajārañjanamāditaḥ
kartavyamavirodhena svadharmasya mahībhritā.
The svadharma, or principal duty of a king is to protect and satisfy the subjects. Madālasā did not advice him to remain disinterested in worldly matters, as she did to the other sons. But at the same time, she also showed him how to tranascend this worldly life of illusion. Before going to Vānaprastha, she left to Alarka the path of salvation. The golden ring she gave him as a parting gift, contained the way of liberation, getting rid of worldly desires.
Suvāhu was one of the elder brothers of Alarka. This prince, who had been so far leading a life of the hermit, took shelter under an enemy of Alarka — so that his brother may attain Tatvajñāna (Tatwajnana). He sent a messenger to Alarka, saying that he should give away his kingdom to Suvāhu. Naturally Alarka was not willing to do so. He said, his brother should claim his right with love, he would not give away the kingdom in fear –

māmevābhetya hārdena yācatāṃ rājyamagrajaḥ
nākrāntyā sampradāsyāmi bhayenālpāmapi kṣitim.
When the battle started, Alarka got defeated by the schemes and conspiracies by his subordinate kingsand associates. In dejection, he then remembered the final advice of his mother. After enjoying the kingdom for a long time, he renounce the world and resorted to the path of ultimate truth.

Sage Mārkaṇḍeya has mentioned Alarka along with Rāmacandra, Nṛga, Bhagīratha, Nābhāga — kings who did not leave the path of virtue and righteousness, thinking that ‘I am very powerful, I’ll do everything using my powers’ .

When Alarka dedicated himself to the contemplation ofBrahman, renouncing his kingdom, a philosophical question occurred to him. He thought that in human body, mind is the most important organ which instigates us to pursue our desires. So, an arrow should be cast at the mind, just like one shoots arrows at an enemy.

Thinking that the mind is the source of all sufferings, Alarka was ready to kill it. His mind then said to him, ‘This arrow of yours will not kill me, it you penetrate your heart. You should better search for another arrow, with which you can kill me. Alarka was convinced. He then thought, the mind is not visible, but the other organs thought which the power and urge of mind can be felt, should be killed at first. When he got ready to kill the organs like nose, tongue, skin, ear and eye,  one by one, they told him – ‘We won’t die by your arrow, but if if we are damaged, it will cost your life ultimately.

In fact, the source of all indriya(s) are embedded in tanmātra, and the Pacabhūta are associated with them, these cannot be destroyed by weapons. And the mind and intellect are finer organs, and it is only through pratyāhāra (pratyahara)-yoga that one can withdraw the organs from viṣaya (vishaya; material objects) and shifted to mind. That mind can be applied to intellect and in this way, one may assimilate oneself in mulā prakṛi, (mula prakriti; supreme nature). So Alarka discovered that the practice of Yoga is the only arrow with which one may conquer the organs including the mind, and attain samādhi. Thus the heroic Alarka used the one weapon of Yoga to win over all the indrya(s) and got assimilated with Parabrahman (the Supreme Self)-
indriyāṇi jaghānāśu vāṇenaikena vīryavān
yogenātmānam aviśya siddhiṃ paramikāṃ gataḥ.

Dattātreya is the sixth incarnation of God Viṣṇu. When Anasūyā, wife of Maharṣi Atri wanted Viṣṇu to be born as her son,he agreed to incarnate himself. In this incarnation, he adviced king Alarka and Daitya(s) like Prahlāda on the lesspns of Ānvīikṣikī or the science of arguments (or spiritual knowlegde, in another version)–
ānvīkṣikīmalarkāya prahlādādibhya ucivān.
This Alarka knew about the infinite power and divine illusion created by God, and so he was able to overcome that illusion, as Brahmā told Devarṣi Nārada.
Several Purāṇa(s) give different information about Alarka’s genealogical identity. Vatsa and Garga were two sons of Pratardana, king of Kāśī. Alarka was the son of this Vatsa, and the father of Sannati –
pratardanasya putrau dvou vatso gargaśca viśrutau.
vatsaputrau hyalarkastu sannatistasya cātmajaḥ.
In Viṣnupurāṇa, however, it is clearly mentioned that Alarka was the son of Pratardana. In a sense, he is also the son of Vatsa, but mentioning the historical genealogy one by one,Viṣnupurāṇa says that Divodāsa, father of king Pratardana affectionately used to call his son ‘Vatsa’ (an endearing term for child). Alarka is the son of that Vatsa, that is, Pratardana, so he is also Vatsa, or ‘child’. It does not mean that he is the son of some other called Vatsa, nor was he the grandson of Pratardana.

Brahmāṇḍapurāṇa (Brahmandapurana), however, has mentioned that Alarka got a long life, by the blessings of Lopāmudrā (Lopamudra), wife of sage Agastya.

lopāmudrāprasādena paramāyuravāptavān.

According to some sources, he was also also cursed by someone but at the end of the curse, as he killed a demon called Kṣemaka (Kshemaka) , he allowed him to stay in Vārāṇasī (Varanasi).

In order to keep his promise, Alarka took his own eyes out, and donated them to a blind Brāhmaṇa-
yācamāne svake netre uddhṛtyāvimana dadau.

When in Rāmāyaṇa (Ramayana), Kaikeyī (Kaikeyi) asked for two boons – the exile of Rāma and the coronation of Bharata, Daśaratha (Dasaratha)tried to dissuade her, using several reasons. But Kaikeyī remained strict, and she tried to instigate him to keep his promise. In this context, she said, ‘Keep your promise, as king Alarka has kept his. So it appears that Alarka was a truthful king.

In Mahābhārata, Alarka is described as being present on the court of Yama.

Alarka was one of the virtuous kings who renounced comsumption of meat in Śārada Kumuda māsa, or in the month of Kārtika (kartika).

He was a conquerer-king in his early life, and later he became a recluse who attained Brahma-samādhi . Perhaps this noble journey of life helped to create a popular saying that one may get rid of many sins, by taking the name of Alarka.