The specific context of the phrase is that an unexplained rumour suddenly spread among the Greeks about to engage the Persians at Mykale that the army of Mardonios had just been defeated (Herodotos 9.100.1). This rumour gave the Greeks courage, allowing them to win at Mykale as well, on the same day as the great battle of Plataia.
In terms of the historical narrative that Herodotos was writing, however, the phrase refers mostly to something we might call "poetic justice" or "karma". The fact that people who were guilty of hubris (aggressive arrogance) or sacrilege would eventually suffer setbacks 'proved' that the gods ultimately decided the fate of man. The Persians burned many Greek temples in the course of their invasion of Greece, and their unlikely defeat, in Herodotos' eyes, was the price they paid for their crimes.
We see a similar view in the works of Xenophon:
Now one could mention many other incidents, both among Greeks and barbarians, to prove that the gods do not fail to take heed of evil men or of those who do unrighteous things; but I will speak here of the case which is before me. The Spartans, namely, who had sworn that they would leave the states independent, after seizing possession of the Akropolis of Thebes were punished by the very men, unaided, who had been wronged, although before that time they had not been conquered by any single one of all the peoples that ever existed. And as for those among the Theban citizens who had led the Spartans into the Akropolis, and had wanted the state to be in subjection to the Spartans, so that they might rule as tyrants themselves - just seven of the men they exiled were enough to destroy the government of these men.
-- Xenophon, Hellenika 5.4.1
Now, of all the Greek historians, Herodotos alone preserves stories of how the gods intervened more directly, through apparitions and timely omens of various kinds. For instance, when the Persians reached the sanctuary at Delphi, he describes the scene like this:
Now when the barbarians drew near and could see the temple, the prophet, whose name was Akeratos, saw certain sacred arms, which no man might touch without sacrilege, brought out of the chamber within and laid before the shrine. So he went to tell the Delphians of this miracle, but when the barbarians came with all speed near to the temple of Athena Pronaia, they were visited by miracles yet greater than the aforesaid. Marvellous indeed it is, that weapons of war should of their own motion appear lying outside in front of the shrine, but the visitation which followed was more wondrous than anything else ever seen. When the barbarians were near to the temple of Athena Pronaia, they were struck by thunderbolts from the sky, and two peaks broken off from Mt Parnassos came rushing among them with a mighty noise and overwhelmed many of them. In addition to this a shout and a cry of triumph were heard from the temple of Athena.
All of this together struck panic into the barbarians, and the Delphians, perceiving that they fled, descended upon them and killed a great number. The survivors fled straight to Boiotia. Those of the barbarians who returned said (as I have been told) that they had seen other divine signs besides what I have just described: two hoplites of stature greater than human, they said, had come after them, slaying and pursuing.
-- Herodotos 8.37-38
This seems to have gone out of style as a credible form of historical narrative, but many Greeks may still have liked to explain events in this way. The notion that all such things could be explained without the gods may have been unique to the educated elite who took an interest in Ionian natural philosophy. By the time of the battle of Leuktra (371 BC), the shrewd commander Epameinondas had such "omens" created for him, trusting that it would persuade his men that the gods were on their side.
Edit: looked up the reference