Jesus' teaching, though in parabolic form, is actually quite scandalous. Calling the nations to judgment is something long looked forward to by the Israelites. Their attitude, both throughout the Old Testament and into the New, was to look down on the nations and to look up to...themselves. After all, they were the recipients of God's grace; they were the ones called to be God's people through their father, Abraham; they were the ones led out of Egypt by Moses into the promised land; they were the ones given the law; they were the ones given God's glory in the Davidic lineage; they were the ones who merely needed to wait out the nations until God sent his promised messiah and lord in David's line to free the people and rescue them for God.
Yet, when the nations are gathered by Jesus (the Son of Man; the King) they are separated by him. They are not separated by nationality or ethnicity. Rather, they are separated as though they were animals—they were separated into two types, two camps. They were separated based on deeds done or not done; not by perceived value; and not by categories decided by nationality, religion ("law"), or lineage ("children of Abraham").
These separation criteria find fulfillment in judgment. The reason for separation is clear—not everyone did the will of their Father, which was surprising to some who looked to improve their religious lot in life. They were separated to be judged. Those who loved Jesus received eternal life. Those who didn't love Jesus received eternal punishment. It's that simple.
How did they love Jesus? By serving the least of his brothers and sisters; because in doing so, they served him. How did they dis-love Jesus? By not serving the least of his brothers and sisters; because when they overlooked them because of their own self-importance, they overlooked Jesus.
But how did Jesus arrive at this teaching? It has been building. Jesus didn't get here in his teaching without precedent.
His teaching began to take on a different, sharper tone once he reached Jerusalem and knew that his life was coming to an end. As he operated within Jerusalem and looked toward the end, he taught that the kingdom of God is about simple, childlike faith and fruit-bearing actions and activities (Matt. 21:15-22). He talked about the great reversal in God's kingdom which is centered around him, where many who think they should be involved completely miss their opportunity, while many who would expect to be left out are in fact both invited and welcomed in (Matt. 22:1-14).
To those who claimed to be concerned about the law (even while they tried to trap Jesus in his teaching), Jesus said that love of God and neighbor fulfill all the commands of the law (Matt. 23:34-40). He condemned hypocrisy by calling out the Pharisees and teachers of the law for leading others astray with their teaching that is focused on obedience of the law for its own sake rather than to please God (Matt. 23).
Finally, he brought it full circle—Jesus taught about his own coming (Matt. 24). The key is to be prepared and diligent, doing good to those you influence (Matt. 24:42-51). Jesus then amplifies this teaching in a series of parables (Matt. 25). First, five virgins who were to be part of the wedding banquet missed out because of failure to pay attention and plan for contingencies (Matt. 25:1-13). Second, one servant who was given money by his master to do good with missed out because he became fearful of his master and failed to use the resources given him to increase his master's reach and kingdom (Matt. 25:14-30). Third, the cursed (who were very surprised to find themselves considered as such) found themselves condemned for failure to search out and serve the least of the King's brothers and sisters, whom he shared solidarity with (Matt. 25:31-46).
We are to live in God's kingdom, being watchful, attentive, diligent in good, using the resources God has given us to serve and love the least among us. By doing so, we serve and love our master, Jesus.