I'm at work, so I'll be brief. The Kenites are mentioned many times in the OT, usually associated with a semi nomadic pastoral herding lifestyle and metal work, centered/originating in the south of Israel but found throughout the land as resources required. They are regarded as a branch of Midianites which is relevant for the introduction of Yahweh to Israel called the Kenite Hypothesis (another time). They lived among the Israelites and Judeans and shared the worship of Yahweh (likely among other gods). So well integrated were they that some were named as serving in David's military and of course we have the famous Jael the Kenite story I touched on in a recent thread about Shamgar. The historicity of these stories is not confirmed by this, only that the writers preserved stories and legends that included these Kenites as part of their culture, which is amazing actually.
Anyway, to the point. Countless commentators have struggled with the rather odd handling of the Cain incident in Genesis. Not only does God not kill Cain but vows to protect him, avenging him 7 times (killing the family of his killer). He also pronounced a curse that he and his eponymous offspring will not be able to farm but have to raise animals and be wanderers. By now you may have picked up on the point. The Kenites are hypothesized to have understood themselves or the author of these legends understood them as descendants of Cain (Kain). The textual and linguistic links are pretty interesting and have been long recognized. But legends this ancient are difficult to dissect with any certainty. Why I bring this up is its bearing on the questions regarding the Cain story. If we accept the proposal that the Kenites were associated with Cain as their eponymous tribal founder, both the farming curse and the promised protection start making sense. The very purpose of these legends becomes clearer.
This passage serves as an origin legend for these Kenite people living as nomadic herdsmen and metal workers among the Israelites. It might have offered an explanation for their lifestyle as well as ensured a measure of protection from locals who might otherwise have seen them as outsiders/enemies.
This is brief and without a lot of references. If there is interest we can dive into it further.