John wrote 1 John from Ephesus most likely sometime between A.D.85-95. While 1 John lacks some of the typical characteristics of a letter (e.g., intro and greetings) and reads like a treatise, it is clearly written to real people who are dealing with a real situation.
When John wrote this letter, he’s around 80 years old! He’s the last remaining apostle alive and one of the few people left who walked with Jesus in the flesh. As an old man, it’s harder for him to travel but he still has responsibility for several churches in the area and those churches are being disturbed and upset by a group of people who have left the church with their own distinctive ideas about Jesus and sin. So John sends a letter to those in the churches to assure them of the truth and encourage them to be faithful. His goal is to reassure the members of the churches so that they can KNOW that they are in the truth and that they have eternal life.