He perceived no iniquity in Yaakov, and saw no perversity in Israel. Hashem his G-d is with him, and the friendship of the King is in him.
Be’er Mayim Chaim: The pasuk would be more reassuring if there actually had been no iniquity in Yaakov! But there was. And we are warned against believing that HKBH casually disregards sin. What, then, did Bilaam mean? Teshuvah is the usual antidote to sin, not Hashem’s refusal to perceive it. The pasuk does not seem to be dealing with teshuvah in any shape or form. So what was it that Hashem was not looking at?
Here is what may be going on:
We observe at times that Hashem is overly generous with a person, even though he does not really deserve such treatment. His relationship with HKBH is not sufficiently close to merit such beneficence. Yet, he receives it because Hashem looks to the future. There, he sees a person who has grown to a point that he does deserve the perks. He treats him at one moment of time according to what he will accomplish in the future.
We enjoyed a history of this as a people. Leaving Egypt, it was difficult if not impossible to make the case for the miraculous and loving treatment of the Bnei Yisrael. G-d looked at them not for what they were at that moment, but what they would be as they stood around Har Sinai, eagerly waiting to receive the Torah.
At times, Hashem’s hanhagah towards a person looks beyond anything he will do in his lifetime, but is predicated upon the birth of some righteous soul generations in the future. This too was shown to us in early history. Lot and his daughters were saved because of the Dovid Ha-Melech who would descend from them hundreds of years later.
Interestingly, this phenomenon only works in one direction. A person’s future misdeeds – or evil descendents – do not factor in the way he is treated at the moment. Again, this was demonstrated in antiquity. As a young, half-dead Yishmael cried out for help, the angels urged Hashem not to save him, pointing to the horrors that his descendents would inflict upon the Jews of the future. He rejected their arguments. “What is he at this hour? Righteous or guilty?” Hashem did not consider Yishmael’s future evil, nor that of his progeny.
This element of HKBH’s Providence explains Avraham’s choice of words in trying to negotiate a reprieve for Sedom. “Perhaps there will be found righteous people within the city,” he said. He did not say perhaps there are righteous people, but perhaps they can be found. He meant that even if such people did not exist at the time, perhaps Hashem’s scrutiny could find and recognize some righteousness that might ensue from them in the distant future.
Balak did not understand any of this. Neither did his contemporaries. They rejected the idea that G-d had anything to do with the Exodus. Why would G-d intervene on behalf of a people who facially seemed no different, no more righteous than the Egyptians? It might have occurred to them that a merciful G-d would take into account future accomplishments, but they reasoned that He would similarly take into account future misdeeds! Balak and company therefore discounted Divine intervention on behalf of the Bnei Yisrael. “Behold, a nation has come out of Egypt” – as if they simply found a way out on there own. They left – through natural means, or through black magic – but they certainly were not taken out by a Divine Hand. Therefore, they reasoned, the Bnei Yisrael should be vulnerable to attack.
Bilaam, their hired gun disagreed. “He perceived no iniquity in Yaakov, and saw no perversity in Israel.” There was iniquity to be seen, both at present and in the future – but Hashem did not pay any attention to it. “Hashem his G-d is with him.” This meanst that He most definitely peers intently into the future in regard to merit. He sees when someone or one of his descendents will relate to Him properly as his G-d. Hashem treats this future accomplishment as if it were already “with him” even thought it hasn’t happened yet in real time, and favors him accordingly.
Hashem, it turns out, sees exactly what He wants to see.
 Based on Be’er Mayim Chaim, Bamidbar 23:21
 Bamidbar 22:5