What was Bila'am thinking? He knew that the Jewish people the nation of Israel were beloved by Hashem, how did he think his curses would be successful?
In order to attempt cursing Klal Yisroel, Bilaam askes Balak to help him offer sacrifices. Rashi explains each time Bilaam offers them that our Avos, Avraham Yitzhak and Yaakov already offered similar sacrifices and that the Jews need not learn this from Bila'am.
The Clevelander Rebbe explained that Bila'am had in mind that by offering sacrifices, the Jews would see his deeds and learn from him.
The Talmud in Brachos teaches that Rasha Bolea Tzadik MiMenu. There are certain times when a wicked person can literally "swallow up" a Tzadik, a more righteous individual. However the word Mimenu "from him" usually read as more righteous than he, is superfluous, since obviously any pious Tzadik is more righteous than a wicked Rasha!
The Rebbe explained that MiMenu can be read as because of him, meaning that if a Tzadik is a Tzadik because of the Rasha, meaning that the Tzadik learned from a wicked person how to be righteous, then the wicked person has the ability to swallow such a Rasha.
If a Tzadik would observe a wicked man and "learn" good from his actions by either acting differentky or actually learning something positive then the wicked person has power of the Tzadik that at an opputrtune time he could swallow him and harm him.
This was Bila'am's intent. The Jews should see his sacrifices and learn from him. They would then be bechinas Tzadik MiMenu, a righteous person who has learned from a wicked one. Then Bila'am would have power over them and his curses would work!
Rashi however points out that this was not the case, the Jews learned from their righteous forebears Avraham, Yitzhak and Yaakov rather than from the wicked Bila'am.