Another important thing to mention about the Cain and Abel story is its function as an etiological legend on the origin of the Kenites who were an important component to Israel's population, tho they not Israelites themselves. The Kenites were a nomadic tribe of metal-smiths (cf. qyn "metal-smith" and Genesis 4:22, identifying Tubal-cain as "the ancestor of all metalworkers in bronze and iron"), who plied their trade while wandering the Arabah rift valley in the late second millenium B.C. and who Genesis 15:19 groups with the Kenezzites as among the aboriginal peoples of the Levant. The OT connects the Kenites with the Midianites (cf. Numbers 10:29; Judges 1:16; 4:11) who were worshippers of Yahweh (cf. Exodus 18), and thus some credit the Kenites with introducing Yahwism to Israel and Judah. The Kenites lived to the south of Judah in mineral-rich areas in Sinai and the Negeb (cf. Numbers 10:29-32, 24:21-22; Judges 1:16; 1 Samuel 15:6; Judges 1:16), and settled also in locales throughout Judea (cf. 1 Chronicles 2:54-55; 1 Samuel 30:29), eventually becoming absorbed into the Judean population. The Rechabites however were a Kenite clan who retained the nomadic lifestyle and dwelled outside Judean cities (Jeremiah 35:1-19), who exactly as in Cain's curse could not "build houses, sow seed, plant vineyards" and who were commanded by their ancestor Jonadab, "You must live in tents all your lives, so that you may live long on the soil to which you are alien" (Jeremiah 35:7). Compare with the curse in Genesis 4:12: "When you till the ground it shall no longer yield you any of its produce. You shall be a fugitive and a wander over the earth", as well as the description of Cain's descendent Jabal as "the ancestor of tent-dwellers" (v. 20). That the Kenites traced their people to an eponymous ancestor Cain is also suggested by Numbers 24:21-22:
"Balaam looked on the Kenites and declaimed his poem. He said: 'Your house was firm, Cain, and your nest perched high in the rock. But the nest belongs to Beor; how long will you be Asshur's captive?' "
Genesis 4 tells the origin of civilization from a Kenite point of view and the conflict between Cain and Abel appears to duplicate the relationship between Kenite brothers Jubal (ybl, cf. hbl "Abel") and Tubal-cain (tbl-kyn, cf. kyn "Cain"), who were founders of shepherding and metal-working respectively. There are literary reasons for considering the Cain and Abel tale as secondary to J, such as the harmonizing gloss in 4:25-26 regarding the birth of Seth, the rendering of this verse in the LXX (which omits the word corresponding to "again" and phrases the verse differently), the different understanding of the curse on agriculture (which in ch. 3 was the result of breaking a divine command, whereas in ch. 4 was the result of fratricide), the gloss destroys the significance of the name-giving, inserting an idea of substitution into the concept of "granting, appointing", and the use of shyt "grant, appoint" and zr' in 4:25-26 is meant to evoke the wording in 3:15, but the intervening story of Cain and Abel breaks the connection between the two and complicates the relation between the two (e.g. why weren't Cain and Abel, born earlier, named the appointed "seed"?). The best explanation seems to be that the story of Cain and Abel originally circulated independently and was only later placed in its current context; this is implied by the story itself, which assumes an already-populated world (e.g. Cain and his wife, Cain's fear of being murdered tho he had just murdered his brother). Some critics have thus proposed that in the more original form of the Kenite etiological legend, Cain was the founder of humanity, started civilization, built cities, invented agriculture, and his descendents invented music, metal-working, and shepherding, and the fratricide occurred at some later point in the primeval narrative.
There is also the wholesale duplication of the Kenite genealogy in P's Sethite genealogy in ch. 5, whereas only fragments remain of J's Sethite geneaology (cf. 4:25-26, 5:29). This has long puzzled Bible scholars, as does the bizarre statement in 4:26: "And to Seth also was born a son; and he called his name Enosh, as it was then that men began to call upon the name (shm) of Yahweh". Such statements throughout J serve to explain the meaning of the name, but Enosh means "man" not "name". On the other hand "Shem" who appears just a chapter later as a son of Noah, is exactly the name that should occur in 4:26. This suggests that the redactor of Genesis likely expunged and altered most of J's Sethite genealogy (such as taking a comment about Shem's birth and moving it to the description of Enosh's birth), and used P's genealogy instead (which was itself based on some variant of the Kenite genealogy). The fact that Enosh means "man" also suggests that the source traditions of P may have designated the first human as Enosh, who fathered the first born-child Seth, just as J (without the interpolated Cain and Abel chapter) would have had Seth as the first born-child of Adam (the appointed (shyt) "seed" (zr') expected in 3:15). J's Sethite genealogy however may have borne little resemblence to P's version; since very little of it has been preserved, we likely will never know. What is interesting, however, is that just as Cain is named as the eponymous ancestor of the Kenite tribe in Numbers 24:21-22, so does the same oracle refer to Seth eponymously in connection with a Moabite tribe:
"A star from Jacob takes the leadership, a sceptre arises from Israel. It crushes the brows of Moab, the skulls of all the sons of Seth" (Numbers 24:17).
There is also an interesting coincidence in Genesis 25:4 in which the eponymous ancestor Midian (ancestor of the Midianites) became father to Hanoch. The Kenites are associated with the Midianites in Numbers 10:29, Judges 1:16; 4:11, and in Genesis 4:17 Cain himself was the father of Enoch ("Hanoch" in Hebrew, the same name). The picture is that the stories and genealogies in Genesis are drawn from disparite sources, sometimes relating to the same peoples, sometimes not, but placed in linear order to tell one single story.