In John’s day, there were people who were departing from the church (and taking others with them), who claimed a deeper knowledge of the truth, who denied that the man called Jesus was (and still is) the Son of God, and who took a free-and-easy approach to what the "unenlightened" speak of as "sin".
But, in reality, these people were leaving the light and walking into the darkness. They did not know God, whatever they claimed, and the hatred that filled their lives demonstrated that they were still under the power of the evil one—particularly their hatred of those who held to the traditional faith of the church, as passed down by John and other eyewitnesses (and as recorded for us in the New Testament).
John wrote his first letter to warn the church about these people, and to urge those he loved as his "little children" to keep walking in the light. He wrote to remind them that Jesus Christ had come in the flesh to deal with the problem of sin through his death, and to destroy the works of the evil one. The love that Christians had begun to find for one another demonstrated that they genuinely knew God and that by their faith they had overcome the world—the world that will hate them, just as it hated Jesus himself.
Does 1 John strike you as being relevant for us today?