The choice for the manpower pools exploited to produce certain classes of soldiers in an army, as well as the structures and institutions which facilitated the continuation of such class of soldiers, was dictated by several factors, namely : 1) The available stock and quality of military labour within a kingdom 2) The political and fiscal feasibility of creating such a corps 3) The socio-political ramifications of the existence of such corps. This is why while your question applies to certain examples it doesn't apply to certain others. It was a mixture of the above mentioned factors among others which dictated the choice of a particular military labour pool and the structures to incorporate it.
For instance, speaking of the Janissaries, we can make the following observations and given that this is a subject which delays with military slavery, for clarity and convenience, I'll use the words ghulam for enslaved person and malik for master interchangeably.
First and foremost, a distinction must be drawn between ordinary ghulams and military slaves. An ordinary slave, is one who can be employed in virtually any capacity that the malik so chooses, albeit owning to social and practical restrictions such ghulams would usually be employed in positions which lended them no power or authority, since there was a social stigma in the idea of a ordinary slave wielding weapons or holding authority in societies which associated such professions as the exclusive domain of certain racial or ethnic groups. Also, Sultans wanted to avoid household ghulams , who were anyway neither trained nor predisposed for the work of a solider or administrator or scribe, from being employed in such positions, as it would be counterproductive and an overall meaningless exercise. Meanwhile, a military slave was a different matter.
Military slaves provided a Sultan with a force which was trained and disciplined in military work, and was singularly loyal to him, and in theory his dynasty and polity. Given their nature and advantages, great care was taken in selecting the individual recruits to a military slave corps (from here on out referred to as the ghulam corps for convenience). Unlike ordinary ghulams who could be acquired via purchase, abduction, or capture in war without consideration for their age which could be anywhere between childhood to adulthood, military slaves were almost exclusively recruited or acquired at a young age. They were selected on the basis of their physique, their "stock" (being from such racial or ethnic groups which would be considered predisposed for warfare, owing to their history, culture or both. For example, Turks were considered excellent military slaves, owing to their renown as mounted warriors, meanwhile Christian slaves from the Balkans were expected to provide quality infantry and artillery corps, as well as diminish the capacity of these lands to rebel, by subtracting from these regions a section of their manpower) and their ability to meet such standards that the Sultans deemed fit or necessary. Those who met the standards and were considered to be the best choices out of all acquired were stationed as the Sultan's personal guard. These military slaves were not merely the armed force that guarded the Sultan's person, but were often the pool out of which the Sultan drew the officers who would administer parts of his realms and would occupy important positions at court. Those ghulams who were not part of this elite corps, were then relegated to important garrison duties or to be part of the Sultan's centralised armed forces. Here, we see the differences between the social position of an ordinary slave and a military slave. The latter, being a position of power and influence. A military ghulam was constantly in the presence of the highest nobility of the realm, and would not be treated as a servant but rather as a commander, a general or a respectable guard of the Emperor. Someone to be feared or respected.
Once acquired, these ghulams since a young age, often as young as 7 or 9, were put through the rigorous training and disciplinary procedures that were considered necessary to mould them into a fighting force. Further, they would also be put through a process of indoctrination. Young military slaves, often from non-Muslim backgrounds would be converted to Islam and raised according to Islamic traditions and values. The purpose of this process of isolation, training and indoctrination was to make sure that the emerging corps of ghulams would be efficient in military service, would adhere to the values and traditions of the Sultan and his people and therefore would not perceive the Sultan or his people with antagonism. And the isolation of the young ghulam and the limitation of his social interactions to the other ghulams of the corps ensured that the young boys abandoned their clan and tribal identities and would perceive the corps as their clan and tribe.
The idea of these ghulams rising in power and usurping the Throne of their Sultans for themselves, either by rebellions, by intrigue or by controlling or removing the successors of the Sultan was quite apparent to the Muslim States/Dynasties that raised these formations. It was owing to this possibility that several checks and balances existed within the system itself. First and foremost, the fact that the ghulams were acquired at a young age and were brought from their regions to the territories of the Sultan, meant that they were in an environment completely alien to them, where they had no connections and they often couldn't even speak the language. Further the complete isolation of these slaves from a young age, from the outside world, meant they became dependent on the Sultan for their survival. Furthermore, restrictions on the slave's access to property, and their freedom to marry and have families ensured that these men had no families, no ties, no dynasties to sire and therefore posed no serious threat to the Sultan as they would not act in their or their family's personal interests. Finally, the indoctrination into their new religion and the culture of their sultan, meant that the ghulams associated with the culture and religion of the state, which meant that the chances of a reprisal along communal lines was further reduced.
In conclusion, Janissaries, were a corps created to assuage the cultural and political apprehensions of the Sultan, and further to provide the Sultanate with a corps of infantry, which could be trained and moulded according to the Sultan's preference, and would remain, in theory, completely loyal to him and his dynasty.
However, there are examples, where such an exclusionary structure, and such a restrictive and prohibiting system of recruitment and administration were simply not considered necessary, since the political, fiscal and social considerations of the "state" permitted for the recruitment, training and maintenance of "citizen" derived elite corps.
By 1775, the trained army of the Nawab of Awadh, Shuja-ud-Daulah, came up to 150,000-160,000. British reports suggested that at least 20 batallions, had come up as the "most perfect" of the type of the British Army. The infantry had started receiving flintlocks and were almost entirely armed with them. European style trained infantry were an exceptional feature on Indian battlefields, and a well maintained and well trained corps was indeed an elite formation. These infantrymen, were recruited entirely out if Awadh itself, being constituted by the military castes of local Brahmins and Rajputs, the former also forming almost the entirety of the Gossains, another exceptional feature of Awadhi armies in the period.
Another formation that could be interpreted as elite, were the Ahadis. The Ahadis were individual, aspiring officers who did not have the means to raise their own troops in order to warrant an Imperial mansab or rank ( a Mansab was the rank assigned to all nobles and officers of the Empire, it implied their payroll and troop quota), but still showed potential for leadership and command. These men were recruited by the Emperor since the days of Akbar himself, according to the the Ain-i-Akbari, Akbar maintained only 12,000 cavalry and 12,000 matchlockmen, these men being known as Ahadis
Sources :
Pipes, Daniel. Slave, Soldiers and Islam, 1981
Jackson, Peter. The Delhi Sultanate: A Political and Military History, 2003
Roy, Kaushik. Military Manpower, Armies and Warfare in South Asia, 2013
Gommans, Jos. Mughal Warfare, Indian Frontiers and High Roads to Empire, 1500-1700, 2002