Joshua gathered the tribes of Israel and recounted God's faithfulness in delivering them from slavery in Egypt and guiding them to the promised land despite opposition from Balak, king of Moab, who tried to curse them by hiring Balaam. God instead put blessings on the Israelites through Balaam. However, the Israelites later brought God's anger on themselves by worshipping Baal and joining in sacrifices to Moabite gods, leading to a plague that killed 24,000 until Phinehas intervened.