Biologist Michael Soule traces it:
Well, let’s start with greed, which evolutionarily is by far the oldest sin — as old as life itself. All organisms have to seek resources, and in our species this desire for energy leads to the sin of greed, because our awareness of selfishness lets us choose to be greedy or not. Competition for resources is also ancient, and with competition comes aversion, or anger, toward one’s competitors. So the second-oldest vice is anger.
Then you have the ancient visceral impulses, those that arise from the animal needs to sleep, eat, and mate: in humans these become sloth, gluttony, and lust. … The two remaining sins are envy and pride, the only so-called sins that are nearly uniquely human. They’re by far the most recent ones, located in the young neocortex, according to functional MRI scans. They require theory of mind — the capacity to understand that other people have minds — and they can only exist in highly social animals.
Erika Check Hayden takes a closer look at sloth. Cassandra Willyard focuses on envy.