Jesus knew his disciples' hearts, and that some were desiring positions in God's kingdom that would (in their opinion) give them an elevated status - that they would 'rank' higher than their fellows. They were thinking of 'greatness' in human terms.
Jesus had to change their thinking by turning upside-down their ideas of what constitutes greatness. So, he sat them down and began to say that whoever wanted to be first, would be the last of all, and would minister to all the others. To illustrate what he meant, he took a child, set him in the midst of them and took the child in his arms. The point of Jesus using the word 'first' instead of 'greatest' comes in verse 37:
"Whoever may receive one of such children in my name, doth receive me,
and whoever may receive me, doth not receive me, but him who sent me."
What could be greater than receiving the Father, by receiving Christ (by faith)? Such humility, of serving others, not seeking to be great but to serve - that is what makes a person great in God's eyes. Having simple child-like faith and trust causes a disciple to humbly serve without any thought as to that working towards being 'elevated' and looked up to. Those who are first appear to be last, humanly speaking. Such ones are truly great though other humans might hardly even notice them.
The awful thing about this vital lesson is that a short while later, James and John (the sons of Zebedee) approached Jesus to request being positioned on his left and right side in the glory. (Mark 10:35-45) Had they learned nothing? So Jesus had to repeat what he'd said in chapter 9, that whoever wanted to be great among them must minister to the others; he who wanted to be first must be servant of all, as was he:
"...for even the Son of Man came not to be ministered to, but to
minister, and to give his life a ransom for many." Mark 10:45 YLT
It could not be any clearer, could it?