The Sea Peoples were not a single people with a single origin. They were a multitude of peoples who all appeared at roughly the same time and raided and attacked the entire coastline of the Southern Levant (from Syria to Egypt) at the end of the Late Bronze Age. Some of the tribes of the Sea Peoples are: the Sherden, Peleset, Denyen, Lukka, Shekelesh, and others. Of all of them, the Peleset are probably the ones you are most familiar with, they became the Philistines of the Old Testament. They are also the ones I am most familiar with, as I have spent the better part of a decade excavating them.
The Philistines almost certainly originated in the Aegean Sea area, as their early pottery is decorated in the Mycenean style, and their early hearths are square, which is an Aegean feature. Where specifically within the Aegean Sea area is not well understood. I have heard several theories which range from someplace near the southwestern coast of Turkey to someplace near the coast of Greece (Mycenae). Some scholars argue that they are an indigenous (Canaanite) movement, but their material culture is so incredibly different at the beginning of their occupation of the land from anything that was there before or after that I believe that position is untenable.
The Ekwesh, who have been associated with the Greek Achaeans (who appear in Homer's epic), could possibly be related to people groups present at the Trojan War. The Hittites mention a people group called the Ahhiyawa (identified with the Achaeans) who are mentioned as being in hostility with the city of Wilusa (which has been identified with Troy).
The Lukka were most likely southern Anatolian people. Lukka in Anatolia predated the Sea Peoples invasion of Egypt by 100 years. They may have been driven from their homeland after leaving their language and name imprinted on the landscape through conflict with the Hittites, or they may simply have been searching for prosperous places to plunder. The Hittite king Suppiluliuma II (ruled 1207–1178 BC, during the time of the Sea People invasion) notes in an inscription that "My father, behold, the enemy's ships came (here); my cities(?) were burned, and they did evil things in my country. Does not my father know that all my troops and chariots(?) are in the Hittite country, and all my ships are in the land of Lukka? . . . Thus, the country is abandoned to itself. May my father know it: the seven ships of the enemy that came here inflicted much damage upon us" (Jean Nougaryol et al. (1968) Ugaritica V: 87-90 no.24) Therefore, the Lukka lands were adjacent to the sea, probably southwestern Anatolia near the border with Syria, giving them easy access to boats and shipping.
I am not nearly as knowledgeable about the historicity of the Trojan War, other than the fact that scholars do agree that there was a city, and that it was in conflict with Greek people groups. To the best of my knowledge, most scholars agree that Troy level VIIa is the one asssociated with Homer's Troy, and this level dates to 1300–1190 BC, which encompasses the time that the Sea Peoples were on the rampage.
So in short, they all most likely are from the general Aegean region, some from Anatolia and some from Greece. The timing is generally right for some of the Sea Peoples to have participated in the conflict that Homer romanticized. However, this was a time of general unrest in the Aegean, and so they were all most likely refugees from one conflict or another.
For further reading, I suggest the following sources.
This wikipedia article is pretty well-researched and will give you an overview of everything.
This is the overview site report for the site of Ashkelon, likely the first Philistine settlement and one of their major strongholds in Israel.
Betancourt, Philip P. "The Aegean and the origin of the Sea Peoples." The Sea Peoples and their world: a reassessment (2000): 297-303.. I linked to this book earlier, but this is a specific chapter about their origins.
hi! you'll find some discussion in the FAQ