Egypt saw enough conflict with Libyan tribes to build coastal forts by the 13th Century BCE. Stretching far west of the Nile Delta, the forts could delay any Libyan attack from the west and alert the capital of an invasion. So went the theory. The forts certainly weren't effective in 1208 BCE when the Libu tribe led Libyan troops to attack the Nile Delta itself, along with the aid of the mysterious Sea People. It didn't matter that Egypt swiftly repelled the invasion. A direct incursion into the heart of Egypt was a powerful lesson to the surviving Libyans.
After decades of simmering conflict between Libya and Egypt, the Libyan Berber tribe known as the Meshwesh took this lesson to heart. They assembled their allies, which once more included the Sea People, and invaded in 1181 BCE. Egypt held off the armies and lined the shores of the Nile with archers to pelt Sea People invaders. A 1175 BCE invasion led solely by the Meshwesh brought them to utter defeat, internment, and subsequent incorporation into Egypt.