Solomon shows in the last verses of this chapter that even if a nation has a wise king, it does not mean that everything will go well. The affection of the people can simply disappear again. The favour of public opinion can suddenly change.
The youth was even in prison. He may have been imprisoned for his criticism of the king or the government: a political prisoner. The people have placed their hope in him. Then the day arrives when he is released. He takes over power. His poor existence from birth could not prevent him from becoming king. He can take power because the masses support him. They built their hopes, their future, on him. You often see this happening in history and politics. People then have very high expectations of a new ruler. Everything will be different and better now. Improvement also has to happen very quickly. Large crowds of people cheer. People who are having a hard time and who have been oppressed for a long time quickly become very enthusiastic.
We see something similar in the life of the Lord Jesus. The Jews are living under the government of foreign rulers: the emperor of Rome and the Edomite King Herod. The Jews yearn for freedom. When the Lord Jesus performs miracles and says that he is the Messiah, the people intend to make him king. See, among others, John 6:15; Mark 11:9–10.
14 For he went from prison to the throne, though in his own kingdom he had been born poor.