After the death of Tauekel Khan, Esim Khan (1598 - 1628) became the Khan of the Kazakhs. After the death of Abdullah Khan in 1598, domination of the dynasty of Shaybanids in Bukhara virtually ceased. a new dynasty of Ashtarkhanids came to power; it traces its origins to the Astrakhan khans - descendants of Tukai-Timur (son of Jochi). The subject of repeated and prolonged dispute between Kazakh rulers and Ashtarkhanids became Tashkent - an important commercial and economic center. Power over Tashkent constantly passed from hand of Esim Khan to hand of Ashtarhanid Khan (Wali Muhammad Khan, ruled from 1606 to 1610; Imamkuli Khan from 1611 to 1642), and from Esim to another Kazakh ruler, Tursun Khan.
Relations with Kalmaks, moving at the end of the XVI century far to the west, began to take in the XVII century an important place in the foreign policy of the Kazakh rulers. The absence of natural boundaries between their possessions and the constant competition for the possession of nomadic territories caused frequent clashes and wars.
The Chinese sources called western Mongols as elyuts. Words Kalmaks, Oirats, Elyuts and term Dzhungars (people of the "left side”, "left-wing") - these are different names of the West Mongol Choros, Hoshout, Torgouts, Derbet tribes. They are orginized "Oirat alliance" of tribes in the second half to XIV and went out from the power of Khan of All Mongols and became being managed by their leaders (Taishi). At the end of the first half of the XV century, Kalmaks were headed by Esen Taishi. He managed to combine all of the Oirat tribes and generations in one union, and even extend his authority over Eastern Mongolia. However, with the death of Esen Taishi (1455) ended political power of Kalmaks for some time. Only at the beginning of the XVII century, among Oirats reappeared vigorous and warlike leaders. The first of these leaders was Choros Hara-Hula-Taishi, who managed to unite most of the Oirats. He led the campaign of all oirats against the Kazakhs, and it was his energetic actions that eventually led to the establishment of the state, called the Dzhungar Khanate. Hara-Hula Taishi died in 1634, his son huntayshi Batur ruled after hime, and, 1635 year is recognized in the science as the year of formation of Dzhungar Khanate.
From the first decades of the XVII century, the balance of power of the Kazakh Khanate that was torn by internecine strife and by Oirat group, united in a single union, changed and became unfavorable for the Kazakhs.
After the death of Esim Khan, strife began again and continued for several years in the Kazakh Khanate. In the end, Esim Khan’s son, Jangir (Jahangir,Yangir, Yangar) was proclaimed Khan. His whole life was spent in the fight against Kalmaks because of the possession of nomadic territories in Zhetysu.
In this war, the leader of the Kazakhs, Jangir was captured by Kalmaks but, by some chance, he regained his freedom. Freed from captivity, he became a lifelong Oirats’ implacable enemy and did not cease to trouble them by partial raids.
From his part, huntayshy Batur, wanting to pacify troublesome neighbor, brought together army of 50 thousand people and, in 1643, invaded to the territories of Kazakhs. A firstly successful campaign ended in defeat of Huntayshy and retreat of Kalmaks with heavy losses. In this war on the side of the Kazakhs were Kyrgyz militia and detachment of the Emir of Bukhara Khanate, Yalangtush-bey.
Jahangir Khan died in one of the battles with Kalmaks. He is buried in the Turkestan city, near the mosque of Khoja Ahmat Yssawi.
In the XVII - XVIII centuries, Kazakhs of steppe regions have remained their historically established sector of the economy - the nomadic and semi-nomadic pastoralism. The main types of livestock were sheep, horses, and camels. Cattle bred in small numbers, mainly in the areas of settlement.
Previously established routes and annual cycles of nomadism with the change of seasonal pastures (cockteu dzhaylyau, kuzdeu, kystau) entrenched. Herding was dependent on natural conditions. Fodder had not been made, in the winter, cattle was at grazing. A massive loss of livestock often happened in severe winters, nomadic pastoralists were ruined, and many become settled. The forms of doing nomadic herding and its productivity improved slowly. Maintained and continuously improved livestock management skills. Kazakh dwelling - yurt, and farm implements were well adapted to the nomadic and processing of livestock products. Life of Kazakh family has been largely dependent on the nomadic pastoral economy. It gave the Kazakhs food, materials for clothing and shoes, appliances and furniture of the yurt, vehicles for migrations.
Nomadic pastoralists were engaged in domestic fisheries, mainly in processing of animal raw materials. The produced felts, carpets, clothing, shoes, leather ware, harness, and etc. Although the Kazakh economy has remained largely natural, it contained a surplus of production and exchange of goods and products produced by urban residents and farmers. Nomads pastoralists cattle ranchers, brought leather, wool, and things made of them, as well as cold steel, wood products, sold furs, fur coats and hats to the markets of Turkestan towns like Signak, Sauran and etc. Pastoralists, in exchange, received cotton and silk fabrics, articles of pottery and metal production, finished fabrics and leather, weapons and much more.
Kazakhs knew settled and semi-settled agriculture and urban culture. Constant communication between nomadic economy of steppe areas and areas of settled agriculture and urban farming has been an integral feature of the economic life of the Kazakh society. Nomads created centers of agriculture, settled and semi-settled villages in the wintering grounds.
The economic system of the Kazakh Khanate is based on two complementary economic structures - nomadic pastoral and settled agricultural, urban structures.
Urban life continued to develop in Southern Kazakhstan. Each of the cities was the center of a vast agricultural area with developed irrigated agriculture, commodity production of grain and other agricultural products. Artificial irrigation continued to develop on a large scale and was based on the canals and irrigation ditches. There were artisan quarters in the cities; ceramics, blacksmithing, woodworking, glass-blowing, weaving, leather, jewelry and civil engineering crafts also developed. The fortification system was developed too in the cities. Dwellings, places of worship and public buildings, mosques, shrines, baths, covered markets, caravanserais, were constructed.
Most researchers believe that public relations of the Kazakhs in the XVII - XVIII centuries were patriarchal-feudal ones. Communal form of land use dominated in the steppe regions. Cattle were in a private and in family-owned forms and were the main measure of wealth and material status of nomads. Supreme Khan was a land steward.
Stable form of feudal conditional land tenure and land ownership has established in the southern regions of Kazakhstan. The sources referred to such forms of land tenure and property rights, as Soyurgal, Iqta‘, Mielke, Waqf.
The basis of division of the Kazakh society on caste laid not so much on property, but on social origin. Ak suyek (White Bone), the highest aristocratic estate, were treated descendants of Genghis Khan: khans and sultans. All the rest of the population belonged to the Khanate’s lower classes - Kara suyek (Black Bone), regardless of wealth.
The grandson of the famous Esim Khan, the son and successor of Jangir Khan, Tauke was the head of the Kazakh society for about 35 years (1680 - 1715/18's), and the era of his reign forever etched in the historical memory of the nomadic people of that region as the "golden age" of the history of the Kazakh people. According to the historian A. Levshina: "This golden age is the age of the reign of the famous Tauke Khan, who, according to legend, was really genius in his kind, and in the annals of the Cossack must stand together with Solon and Lycurgus. He curbed worried labor and generations, and did not only introduce them to order, but also gave them many laws. "
In terms of territorial fragmentation and isolation of nomads in the vast areas of territory, Tauke stand in front of a difficult task to strengthen economic and political ties between jüzs and overcome the political collapse of the Kazakh Khanate.
Tauke Khan is called the creator of "Jety Zhargy” with reference to Kazakh legends. He seemed to be gathered for the council three beys, Tole bey of the Great jüz, Kazybek bey of the Middle jüz, Aiteke bey of the Junior jüz, and discussed with them why Kazakhs frequently fighted with each other; knowing this helped him toapprove some laws. According to another legend, Tauke Khan gathered seven beys in the tract of Kul-Tobe (Syr Darya region) and these beys joined the old customs of the Kasym and Ishim khans in new customes called "Jety Zhargy". Therefore, "Jety Zhargy" known in the scientific literature as the "Code" of Tauke Khan as well "Laws" of Tauke Khan.
Jety Zhargy most likely appeared in the 70th of the XVII century. It was a difficult time in the history of the Kazakh Khanate. Tauke had to wage a war on two fronts with the Ashtarkhanids for towns near Syr Darya and with Dzhungars in the south-east. In addition, fights within the Khanate did not stop. In order to strengthen Khanate internally these laws were adopted.
The main principles and rules of law of the medieval Kazakh society were written in the "Jety Zhargy”. "Code" of Tauke Khan legally secured norms of administrative, criminal and civil law, and the provisions on taxes and religious beliefs, which mean they covered almost all aspects of life.
According to the "Jety Zhargy" the supreme power in the state was concentrated in the hands of Khan. Management was carried out by the sultans and tribal elders, through public meetings, kurultais, where attending people had to carry a weapon with them. However, Tauke sought to limit the power of the sultans, to strengthen the centralization by control of three jüzs through responsible beys.
Criminal law provisions included the following crimes: murder, mutilation, rape, beatings, insults, non-filial duty, theft, adultery, and etc. The penalties provided for vendetta: blood for blood, injury for injury. Kun, the payoff of the punishment was installed. The death penaltyapplied in the form of hanging and stoning for killing husband by wife, the murder by a woman of illegally begotten child, wife adultery, blasphemy, etc.
Kunasize depended on the social status of the victim and the offender. So, for the murder of a simple man a murderer could pay off by giving his family 1000 sheep, of the woman - 500, for the murder of Sultan or Khodjy, kun was charged as per seven simple people. In general, the customary laws have been adapted for the protection of property and protection of the privileges of the Kazakh elite.
At the time, Tauke Khan managed to overcome internal strife and restore calm in jüzs thereby secure nomadic territories of Kazakh tribes from outside intruders.