These verses confirms that verses 18-20 are not out of place. Job returns to a consideration of the evil which the wicked do and this is given as the reason why they must ultimately be punished.
God is secretly watching them all the time. Why does he let them go so far before he calls them to account? Because he intends to expose their hearts to public gaze. He is in control of every situation; no matter how much leeway he gives his enemies he is able to undo their evil schemes in a moment. Every tangle can be untangled by the Lord, and his omnipotence is all the more evident and all the more wonderful when it is able to correct the worse that the enemy can do. This way of governing the world also teaches his people faith and it teaches them patience and hope and many other important qualities of character.
Yes, the wicked are exalted for a time, but what does that matter once they have been brought down. Where is the harm to God’s cause in their temporary triumph when so much good comes out of it? How many lessons about the wisdom of God the righteous are taught in the process! And they see that they suffered no real harm but only an apparent harm, but actually much gain. Lessons that are learnt and cannot be learnt by any other means are not to be despised though they are painful at the time.
When God brings them low and they are dried out like the heads of grain, then they have received a full answer to all their triumphant boasting when. They must then eat their own words and admit how greatly they were mistaken. Not a single triumph is left to them, but the fabric of their lives is demolished piece by piece. This is enough; it is God’s full and final answer. They wanted to imagine themselves as special, as different from others, but they have not been able to escape the common destiny of all fallen men and women.