Babur's account of his 22 years in Afghanistan, which breaks off in 1508 and resumes in 1519, first of all shows a man recently transformed from a refugee to a ruler by the power of legitimacy, struggling to survive in the face of further Uzbek assaults in an impoverished Kabul province, which was populated by a contentious maelstrom of Afghan tribes. Gradually, he achieved a measure of control and stability in Kabul and the city's immediate hinterlands, and despite the many alarms and excursions of the following years, he came to love the city and its mountainous environs. The irony of his Afghan life is that, while he ruled in Kabul for more than two decades, he always viewed his occupation of the city as a temporary necessity. During the first decade, he hoped to use it as a base to return north and restore Timurid rule in Samarqand. When that attempt failed in 1511, he gradually turned his gaze to the southeast, and after 1514, Kabul became a staging ground for the probing attacks on India that culminated in his invasion and victory over the Ludi Afghans at the Battle of Panipat in April 1526.
Yet, not only did Babur mature in Kabul, where he enjoyed a considerable degree of stability for the first time in his young life, but these were his years of great personal and intellectual accomplishment. While ruling the city, he fathered eighteen children with four wives, wrote a considerable body of Turki poetry, composed an ambitious verse treatise on Islamic law, and finally, abandoned his childhood abstinence. It was also during these two decades that he created a congenial life for himself, revelling in alcohol-fuelled suhbatlar, the convivial gatherings of friends, poets, artists and musicians, that came to represent for him the good life, a life lived as much as possible in the aesthetically pleasing context of the formal Persianate garden. It was the civilised norm he had hoped to enjoy in Samarqand and briefly experienced in Herat when he visited the great Timurid city in 1506. He longed to experience this life again after his victorious campaigns in India, but once there, he failed to find respite and longed to return north, to what had become for him his Afghan home.