They are the top most commander of Aurangzeb army. The shivaji also went took the post.
Shivaji was led to the foot of the throne where he bowed thrice (salam), after which he was taken to his place among the nobles who stood in two parallel columns in front of the throne.
All this while Shivaji had been forgotten and was inwardly fretting in the back row of nobles. When he learnt that he had been made a commander of 5000 Shivaji cried out, "What! My little son was made a commander of 5000 (after the treaty of Purandar with Raja Jai Singh) without coming to court...am I after all these services (aiding in the invasion of Bijapur), and coming all the way to court, to get the same rank?"
The Shivaji did not get what he want so he became rebel and start fighting. Otherwise he would serve to the Army of Aurangzeb. Refer to wikipedia.