In chapter 4 the story takes a fairly large turn. By now, it has mostly passed over the lives of Adam and Eve who, while still alive, no longer play a major role in the story. As such, we are now reading about the lives of the first children on earth, Cain and Abel. The names Cain and Abel mean "received" and "breath/empty" respectively, though there are other various interpretations proposed by various scholars.
Lot to say here... first I will describe the "historical allegory" analysis, and then give a brief synopsis of my theological analysis.
The historical allegory plays up the farmer/herder tensions implied in this chapter. They take Cain to represent the "farmers" of the fertile crescent and Abel to represent the "herders" of the same region. Remember what I said about tensions over water? That's what is coming into play in this analysis. There's a lot of history to this, which I will mostly skip over. But suffice to say, there have been some transitions between herding peoples and farming peoples, and those transition periods are a euphemism for war/killing/displacement. Just think of Mexican immigration into the US, except instead of there being some degree of racism, imagine the Mexicans all had assault weapons and decided to just kill the people who wouldn't give them money and food. That is the simplest equivalent of what a "transition" in the ancient world looks like. Many scholars like to say that these tensions are imprinted in the story told here. In this case, the Israelites are nomadic herders, so it "makes sense" that they would be the group that pleases God, and also the aggrieved people. Ironically, the punishment of Cain is to be displaced from the land and be forced to "wander the earth", in keeping with the historical allegory of Israel displacing some erstwhile tenants of the now-Israeli countryside.
The standard theological analysis tends to be a lot more nuanced and complex. A lot of the discussion hinges around the question, why did Cain's offering not please God? Many people say many things, but in my opinion none of those interpretations have much weight of evidence behind them. At the end of the day, I don't think anyone presently on earth can give a definitive answer as to why Cain's offering did not please God.
But the rest of the story is still quite informative and I will explain the salient points according to my personal opinion. For one thing, it shows that even just one generation after the sin of Adam and people are already murdering each other. This is why I know that solutions to the world's problems are not going to come from people just... spontaneously deciding to act nicely and work together. The moment your relationship with God is broken (like Cain's clearly is), you really are a candidate for being mastered by sin, so to speak. It really is a life and death struggle between each person and sin, and the only way to be victorious is to get a little help from your one true friend.
Similarly, we see that the descendants of Cain become even more violent, as his seventh generation descendant kills another man and proclaims that (to paraphrase) if Cain avenges himself a little, I will avenge myself MUCH. The biblical pattern is that God is the avenger of wrongs, so both Cain and Lamech are wrong in their approach.
Another aspect is how God is questioning Cain. Again, as with chapter 3, God asks questions for us to know the questions, not for him to know the answers. Cain ironically replies "am I my brother's keeper?" This is doubly ironic because the answer is yes, and because he was using it as a way to say, "how would I know where he is?" when he had murdered him. So it was a lie, and if only he knew the true answer to the question he had just asked, perhaps he would not have committed the crime that forced him to lie like that.
Another aspect is that committing a crime in a certain way will put you under a curse. This is true of sin generally. Whenever you commit a deliberate sin, it will bring a corresponding curse until the sin has been atoned. In this case, Cain pours blood into the ground through murder, and the curse is that the ground is now closed to him and to farming. So it's an instance of "the punishment fitting the crime". Such curses are permanent, but are canceled through repentance and atonement. These concepts will be explained later.
Lastly, we have the perplexing question of "who is Cain being protected from?" This is another critical instance of the Bible clearly eliding out some elements of world history, because while Cain and Abel are the only described human children, Cain is already questioning God about how "whoever finds me will kill me." So from what I've read, scholars usually take two approaches to this. The first is the more obvious, that there are other people around the world, who are either unmentioned descendants of Adam/Eve, or are possibly unmentioned people who God independently created but were not considered important to the main storyline here. The second is that Cain was referencing the people who would *later* be born through Adam, Eve and their children. Since Cain presumably lives some hundreds of years, this is not unreasonable, but it does seem very peculiar that he would be speaking in fear of people who did not yet exist at the time. Perhaps God had been speaking to them about the future rise of the human population, yet such discussions are (once more) not recorded in the Bible, so we are again drifting off into speculation. My personal preference is for theory #1, in keeping with the Bible's tendency to focus on what is salient and to ignore a lot of the trivial details.
At this point, I would like to remind all of my readers to check all of their modern, scientific preconceptions at the door and remember that you are not reading a modern, scientific book. :) I would say more, but explaining the Hebrew mindset is difficult. I will just leave it as an exercise for the reader to learn more about the difference between modern and ancient mindsets.