1 John 5:18 is neither information nor a teaching in the general sense, but part of a polemic against the author's former colleagues. Harold W. Attridge says, in Christianity and Rabbinic Judaism: A Parallel History of Their Origins and Early Development, page 172, that continuing friction among early Christians over the nature of Jesus is evident in the Johannine epistles. He points out that 1 John criticises ‘secessionists’ who departed in a dispute over the reality of sin (1 John 1:8-10) and the fleshly (human) character of Jesus (1 John 4:1-3).
Burton L. Mack recognises this friction and says, in Who Wrote the New Testament, page 215, he believes that the split took place shortly after the start of the second century, with one faction joining other Christian groups of a more centrist leaning, while the other party refused, holding to the tradition of the community but developing in the direction of a Christian gnosticism.
Mack describes the polemic of 1 John as vicious, and says the author's arguments against members of the other faction are ridiculous. The author labels them liars (1 John 1:6-10; 2:4; 4:20) and sinners (1 John 1:8-10) who, by saying they are not sinners, have removed themselves from God's grace.
In 1 John 3:2, the author (known as the Presbyter, or Elder, in 2 John 1:1 and 3 John 1:1) tells his loyal followers that they are the children of God:
1 John 3:2: Beloved, now are we the sons of God, and it doth not yet appear what we shall be: but we know that, when he shall appear, we shall be like him; for we shall see him as he is.
1 John 3:9 tells us that those who are born of God can not sin, but 1 John 3:10 says that his departed colleagues, who do not love their (former) brothers, are of the devil and not of God:
1 John 3:9-10: Whosoever is born of God doth not commit sin; for his seed remaineth in him: and he cannot sin, because he is born of God. In this the children of God are manifest, and the children of the devil: whosoever doeth not righteousness is not of God, neither he that loveth not his brother.
Mack goes on, to say:
He [the Presbyter] did not want to offer his opponents the promise of forgiveness, but since his new soteriology was about sin and forgiveness, the topic could backfire." Because those who had chosen a more gnostic path were not "born of God", verse 3:9 does not apply to them and they will continue to sin.
1 John 5:18-19 summarises the Presbyter's introspective view of his people being born of God, while all around them are those under the control of evil:
1 John 5:18-19: We know that whosoever is born of God sinneth not; but he that is begotten of God keepeth himself, and that wicked one toucheth him not. And we know that we are of God, and the whole world lieth in wickedness.
John 8:44-47 uses similar concepts, but in an entirely different context and with differences of meaning. Here, Jesus is telling the Jews who said they were the children of Abraham, even those who believe in him (John 8:31: "
Then said Jesus to those Jews which believed on him ..."), that their father is the devil and that they are not of God. 1 John reflects this polemic in John's Gospel because the Presbyter was undoubtedly familiar with the words of the Gospel, but the reference is very different.