The Israelites are the primary focus of the stories in the Old Testament, but just who were the Israelites and where did they come from? The Pentateuch and Deuteronomist writings of course give their own explanations, but extra-biblical sources and archaeology produce different conclusions. Unfortunately, those conclusions aren't all clear.
The oldest reference to the Israelites is a reference to an entity named Israel in the northern Canaan region on the Merneptah stela, dating to the end of the 13th century BCE. Documents from el-Amarna from the 14th century BCE indicate that there were at least two small city-states in the Canaan highlands. These city-states may or may not have been Israelite, but the Israelites of the 13th century didn't appear out of thin air and would have needed some time to develop to the point where they were worth mentioning on the Merneptah stela.
Ammuru & Israelites
The Israelites are Semitic, so their ultimate origins must lie with the incursion of nomadic Semitic tribes into the Mesopotamian region from 2300 through 1550 BCE. Mesopotamian sources refer to these Semitic groups as "Ammuru" or "westerners." This became "Amorite," a name more familiar today.
The consensus is that they probably originated in northern Syria and their presence destabilized the Mesopotamian region, leading to several Amorite leaders taking power for themselves. Babylon, for example, was an irrelevant town until the Amorites took control and Hammurabi, Babylon's famous leader, was himself Amorite.
The Amorites were not the same as the Israelites, but both were north-western Semitic groups and the Amorites are the oldest such group we have records for. So the general consensus is that the later Israelites were, one way or another, descended from the Amorites or descended from the same area as the Amorites.
Habiru & Israelites
A group of semi-nomadic tribes, wanderers or perhaps outlaws has sparked interest with scholars as a possible source of the earliest Hebrews. Documents from Mesopotamia and Egypt contain many references to the Habiru, Hapiru, and 'Apiru — how the name is supposed to be pronounced is itself a matter of some debate which is a problem since the connection with the Hebrews ("Ibri") is entirely linguistic.
Another problem is that most of the references seem to mean that the group is made up of outlaws; if they were the original Hebrews we would expect to see a reference to a tribe or ethnic group. Unless, of course, the "tribe" of Hebrews was originally a group of brigands that wasn't even entirely Semitic in nature. That is a possibility, but it's not popular with scholars and it has weaknesses.
Their primary origin is probably western Semitic, based upon the names we have, and the Amorites are often cited as a likely starting point. Not all members of this group were necessarily Semitic, though, and it's also not likely that all members spoke the same language. Whatever their original core membership was, they seem to have been willing to accept any and all outcasts, outlaws, and fugitives.
Accadian documents from the late 16th century BCE describe the Habiru migrating out of Mesopotamia and entering voluntary, temporary bondage. There were Habiru settled throughout Canaan during the 15th century. Some may have lived in their own villages; some definitely lived in the cities. They worked as laborers and mercenaries, but were never treated as natives or citizens — they were always "outsiders" to some degree, always living in separate buildings or even areas.
It appears that in times of weak government the Habiru turned to banditry, raiding the countryside and sometimes even attacking cities. This made difficult conditions even worse and probably played a role in discontent with the presence of Habiru even during stable times.
Shasu of Yhw
There is an interesting linguistic pointer that many have thought might be evidence of the origins of the Israelites. In a 15th century BCE Egyptian list of groups in the Transjordan region, there are six groups of Shasu or "wanderers". One of them is the Shasu of Yhw, a label that matches the Hebrew YHWH (Yahweh).
These are almost certainly not the original Israelites, however, because in the later Merneptah reliefs the Israelites are referred to as a people rather than as wanderers. Whatever the Shasu of Yhw were, though, they may have been worshippers of Yahweh who brought their religion to indigenous groups of Canaan.
Indigenous Origins of the Israelites
There is some indirect archaeological evidence which lends support to the idea that the Israelites arose to some extent out of indigenous sources. There are around 300 or so early Iron Age villages in the highlands that may be the original homes of the ancestors of the Israelites. As William G. Dever explains in "Archaeology and Biblical Interpretation," in Archaeology and Biblical Interpretation:
"[T]hey were not founded on the ruins of earlier cities so they weren't the product of any invasion. Some cultural elements, like pottery, are pretty much the same as those of surrounding Canaanite sites, which indicates strong cultural continuity.
Other cultural elements, like farming methods and tools, are new and distinctive, strongly indicating some sort of discontinuity."
So some elements of these settlements were continuous with the rest of the Canaanite culture and some were not. It is plausible that the Israelites developed out of a combination of new immigrants who joined up with indigenous people. This unification of old and new, domestic and foreign, could have grown into a greater cultural, religious, and political entity that was separate from the surrounding Canaanites and which could then be described several centuries later as always existed just as it appeared.