The army of Ramesses III managed to turn them away; their attacks were most effective in the Levant where Canaanite cities like Ugarit and Hazor were destroyed, in Cyprus, and in Anatolia where the Hittite Empire collapsed about 3,200 years ago.
It's crazy how entire cities and empires can just be destroyed. All this destruction must have been messy and complicated, causing problems for many people.