God knew where he was going and that he always stayed on God's path, treasuring God's Word more than food.
Then, in the 24th chapter, Job ranted about how the wicked never seemed to be brought to the Lord's judgment and that the poor and needy could never get a break. By the end of the chapter though, he did admit that although the rich seemed to rise high, they never had any assurance in life. God is the only path to security. Not physical riches.