In almost any commentary from the last century, the Cain and Abel story in Genesis 4 is typically explained as a justification for/explanation of the conflict between agricultural and nomadic life. There’s something to this, but it’s not merely about two modes of food production. The distinction is between two approaches to ethics.
Cain and Abel
When you commentaries enough you just kinda think: Here we go again. I’ve never really read it explained beyond the surface distinction. But in The Philosophy of Hebrew Scripture by Yoram Hazony, he explained the distinction in terms of the ethic represented by the two characters. Here it is in full:
The life of the farmer.
Cain has piously accepted the curse on the soil, and God’s having sent Adam to work the soil, as unchallengeable. His response is to submit, as his father did before him. And within the framework of this submission, he initiates ways of giving up what little he has as an offer of thanksgiving. In the eyes of the biblical author, Cain represents the life of the farmer, the life of pious submission, obeying in gratitude the custom that has been handed down, which alone provides bread so that man may live.
The life of the shepherd.
Abel takes the curse on the soil as a fact, but not as one that possesses any intrinsic merit, so that it should command his allegiance. The fact that God has decreed it, and that his father has submitted to it, does not make it good. His response is the opposite of submission: He resists with ingenuity and daring, risking the anger of man and God to secure the improvement for himself and for his children. Abel represents the life of the shepherd, which is a life of dissent and initiative, whose aim is to find the good life for man, which is presumed to be God’s true will. (108)
Hazony goes on to observe that while God did not command shepherding, God did make man to be good. God told downcast Cain, “If you do well, won’t you be lifted up? (108)” Meaning, “If you have a problem with the world, make the best of it, bucko!”
Some details in Genesis that he left out make Hazony’s argument tighter. God made man “very good” and commanded man to subdue the earth. So, it doesn’t seem like God wanted man to submit directly to the curse. Instead, he wanted humanity to continue the mission from Genesis 1. The curse did not nullify God’s purpose for creation, it simply made it more difficult to obtain.