Actually, God explains why he makes several of his actions.
In Genesis 8, God explains why he killed everyone in the flood. Humans were polluting the earth with blood and murder. Blood was literally seen as a form of pollution. God says he “regrets” making humans in the first place. The flood is basically a reset button on creation. Afterwards, God puts a rainbow in the sky as a form of impulse control to remind himself never to flood the earth again. He also institutes laws so humans don’t murder each other so much.
In Exodus, God explains his actions clearly. Pharaoh wants to just let the Hebrews go. But God repeatedly “hardens his heart” and forces him to keep the Hebrews. The reason God does this is so he’ll have more chances to intimidate and kill Egyptians with magical plagues in spectacular fashion. The reason God does this, according to God, is to impress his followers, the Israelites.
In Job, we know perfectly well why God allows Satan to torture Job and kill Job’s family. It’s a test of faith, egged on by Satan. Job doesn’t know this, and God gets mad when Job asks “why.” But we, the audience, do, because God is narrated as explaining himself.
Or @gambitking, were you talking about some other God?