(Numbers 22:7:) "So the elders of Moab and the elders of Midian went, with the tools of divination in their hand." For they carried in their hands all kinds of divining instruments through which they divine, so as not to give him a pretext <for refusing to come>. And the divining instruments were in the hand of the elders of Midian, for they said: If he comes with us, he will succeed; but if he delays <even> for an hour, there is no use in him. As soon as they saw that he said (in verse 8), "Lodge here tonight," the elders of Midian went away, for they knew through their divinations that there was no use in them.
Why the Elders of Midian Abandoned Balaam After One Night
Midrash Tanchuma Buber, Balak 7:1
וילכו זקני מואב וזקני מדין וקסמים בידם (שם כב ז). שהוליכו בידם כל מיני קסמים, שהן קוסמים בהם, שלא ליתן לו עלילה, וביד זקני מדין היו הקסמים, שאמרו אם יבא עמנו יצליח, ואם יעכב שעה אין בו תועלת, כיון שראו שאמר לינו פה הלילה, הלכו להם זקני מדין, שידעו בקסמים שלהם שאין בהם תועלת.