Having taught us which sin is unto death and which is not unto death, he then indicates who can sin unto death, and says: one adopted by God can never be afflicted by sin, whether unto death or not unto death. For having once surrendered himself to Christ, who dwells in him through adoption, he remains untouchable by sin. However, lest anyone think that his nature is transformed and becomes already beyond the reach of sin, he adds: "keeps himself," that is, if he does not keep and guard himself from the evil one, then without doubt he will sin. Thus, he attains sinlessness not by nature, but b...y the great gift of God. God, having adopted us, deemed us worthy of such grace that we, preserving and observing the gift given to us from Him, are able even not to sin. Otherwise, since the world (by "world" he means those who have not placed themselves in the position of sons in relation to God through righteous deeds) lies in evil, nothing would have prevented us from joining the perishing, because the imagination of man's heart is diligently inclined to evil from his youth (Gen. 8:21), as God showed at the flood. But since the Son of God came and gave us understanding to know Him, the true God, and to abide in Him, His true Son, Jesus Christ, through this great gift we have come to know that He is the true God and eternal life, and having known this, we remain untested by the evil one and his temptations.
Source: Commentary on 1 John