The Ammonites and Moabites had not welcomed the Israelites with food and water. Instead, they had hired Balaam to put a curse on Israel. (But our God turned the curse into a blessing.)
My people, remember the evil plans of Balak king of Moab and what Balaam son of Beor told Balak. Remember what happened from Acacia to Gilgal so that you will know the Lord does what is right!”
This is because the Ammonites and Moabites did not give you bread and water when you came out of Egypt. And they hired Balaam son of Beor, from Pethor in Northwest Mesopotamia, to put a curse on you.
These false teachers left the right road and lost their way, following the way Balaam went. Balaam was the son of Beor, who loved being paid for doing wrong.