The book of Job opens on a curious courtroom scene, where the satan, or the accuser, challenges God’s policy of rewarding righteous people like Job. He says that Job is only righteous because God has rewarded him. Let him suffer, he says, then we will see his true character.
The rest of the story is presented through dense Hebrew poetry, where Job, his wife, and his friends speculate on why Job is suffering. Isn’t he a righteous man? Why would God allow this? Job accuses God of being unjust and not operating the world according to principles of justice, and he calls on God to explain himself.