I think when John wrote both this letter and the Gospel of John, he wrote from the perspective of someone who had seen a lot when it came to the church and faith. He saw the early church struggle. He saw the church have to deal with the fact that Jesus’ return was taking longer than expected. He saw that sin could infiltrate the church and throw people into spiritual depressions, confusion and even destruction. So, he ends the letter with a few words of perspective.
1 John 5:19-20
We know that we are children of God, and that the whole world is under the control of the evil one. 20 We know also that the Son of God has come and has given us understanding, so that we may know him who is true.