In Matthew 19, Peter asked Jesus a question about rewards for those who had sacrificed for him. Jesus then discussed rewards and noted that the values of God's kingdom are opposite those of the world, which leads right into this parable in Matthew 20.