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.