24:17-19
The ESV labels the section from 24:15 as “Balaam’s Final Oracle”, whereas the NIV splits it up into seven “messages”. The section headings are not actually part of the Bible, though they can be helpful, we should not treat them as “gospel truth”! Balaam prophecies the destruction of Moab by a “sceptre” from Israel, i.e. a king from Israel. The “sons of Sheth” are probably Canaanite Nomads. Verses 18 and 19 then talk about more victories. The key point is that Israel is going to be victorious, despite the wishes of Balak. We need to understand that just because the enemy wants to destroy us, that doesn’t mean he is going to succeed!
24:20-25
There are then three short oracles, foretelling the defeat of Amalek, the Kenites, Ashur and Eber. These were all said in the presence of Balak, or at least 23:25 seems to imply that. Balaam is probably keen to demonstrate to Balak that the words he speaks are true, as there are significant details in the prophecies. In time, Balak would see that Balaam spoke the truth. Balaam does come in for a hard time in the New Testament, though while the narrative here make clear that he is far from pure, his mercenary attitude is more implicit than explicit.