These are slave soldiers which are taken as captives but then are raised to be an elite military unit and eventually often have significant wealth and significant power. Now, you might be wondering why did any of these empires, and these aren't the only ones. You have the Mamluks in other Muslim empires. Why would people create these elite soldiers out of slaves and give them that much power? Well, the answer is they were the safest people to give power to. Remember, these empires are ruling over many tribes and many groups and many kingdoms that are constantly vying for power, trying to establish their own dynasties. And if you allowed people from those various tribes to protect you as emperor, well, there might be a good shot that one of them might wanna kill you and establish their own dynasty.