The Apostle confirms by example how great an evil it is to hate one's brother. Look, he says, Cain hated his brother and killed him, despite the fact that he was his own brother. Cain performed the evil deeds of his father the devil, while Abel, doing righteousness, was a son in relation to God. Here the devil is contrasted with God, and evil deeds with good ones. For this reason Cain, being the opposite of his brother, killed him. Such is the explanation according to the course of the discourse. But the Apostle John altered this order, having a special purpose. For after he had mentioned the ...devil and the fact that those who do evil become his children, it was natural for him to set forth as an example the one who at the beginning of the world hastened to become a son of the devil through evil deeds. Having said what was necessary about Cain and about the fate inherited by those who imitate him, he again turns to love.
Source: Commentary on 1 John