As explained in two posts above, Ephesus had gone through a very turbulent time in the mid-60’s AD, with Paul and Timothy expelling elders from the church who were teaching heresy or living immorally or both, followed by a period of intense persecution when Paul himself was taken from them and executed. Paul’s primary instruction to the church in his second letter to Timothy had been to cleanse themselves from wickedness and become sanctified for good works (2Tim 2:19‑21); a repentance that was even more of a priority than doctrinal correction, which could only follow repentance (2Tim 2:24‑26). Partly from fear of a repeat situation, therefore (1John 4:17‑18), the Ephesian church had become very strict against sin, to the point of equating it with heresy (1John 3:10; 5:16‑17), and making it a justification for excluding immature Christian brethren from fellowship (1John 2:19; 3:23; 4:20–5:1) or denying them the benefit of material support from the church (1John 3:16‑18). It is likely that the primary issue of sin in the church was the issue of ongoing participation in the idolatrous secular culture of Ephesus by recent converts (1John 5:21), whether just in terms of appreciating the aesthetics and achievements of that culture (1John 2:15‑17), or perhaps the issue of dining in idol temples with colleagues at official work functions (cf. 1Cor 8:10; 10:19‑22; contrast 10:25). It is quite possible that the false teachers had been teaching that ‘righteousness’ is just a matter of the heart, and not a matter of outward actions (1John 3:7‑10).
John has a difficult job on his hands, therefore. He has to be very clear in his instruction to the ‘little children’, the immature believers who were still engaging in sin, that they must not continue to sin. But on the other hand, he has to appeal to the ‘young men’ who had stood firm under persecution and held to the truth (1John 2:13-14), and help them to see that they too could not claim to be without sin, and in fact by failing to love their weak brethren they too were committing a sin, as wicked as the sin of Cain (3:10‑18). The ‘fathers’ of the church would certainly remember the ‘old commandment which you have had from the beginning’ (1:7; 2:13-14, 24; 3:11). John has to affirm their rejection of the heretical teaching of those who had left the church (2:18‑26), while also urging them to continue to receive teachers from outside, like himself, who did speak truth (4:1‑6, 14‑15; 5:5‑13, 20). As a result, his letter, which is more of an extended essay than a letter as such, moves back and forth between appeals to the little children to keep themselves from sin and idolatry, and appeals to the more mature members of the church to love and pray for their immature brethren like Jesus did (2:5‑6) rather than ‘hating’ them by excluding them (5:14‑17).
As for the specific form of doctrinal heresy that John and the Ephesian church were facing, it is clear from the first paragraph of 1 John that it has to do with the identity of Jesus as both having been with the Father from the beginning and yet also having been a real tangible man (1John 1:1‑3). The false teachers who had left the Ephesian church were those who denied that Jesus was the Messiah (2:22; 5:1), that Jesus is ‘Messiah come in the flesh’ (4:2), and that Jesus is ‘the Son of God’ (4:15; 5:5). When John defines the ‘false-Messiah’ [i.e. ‘anti-christ’] teaching as the denial that Jesus is the Messiah, he is probably not referring to Jews outside the church who did not believe Jesus was the fulfilment of Old Testament prophecies about the Messiah (though that would also apply). Rather, he is focusing on heresy within the church that redefines what sort of ‘Messiah’ Jesus actually is, which is just as much an ‘anti-christ’ teaching. John clarifies further in 1 John 2:22‑23 that what he means by those who deny Jesus’ Messiah-ship is the denial of Jesus as Son and therefore of God as Father, something that the writer to the Hebrews emphasises also in his first two chapters about Jesus being superior to the angels. The theme of Jesus’ divine sonship appears throughout 1 John (1:3, 7; 2:22‑24; 3:8, 23; 4:10, 14‑15; 5:1, 4‑5, 9‑13, 18, 20), but John deliberately mixes this with a concentration on Jesus’ very real humanity, whether that is His tangibility (1:1‑3) or His flesh (4:2), or His very real blood (1:7; 5:6‑8). The ‘water’ refers to Jesus’ baptism at which God testified that Jesus is His Son (5:6, 9‑11), but this does not contradict the testimony of the ‘blood’ of Jesus poured out at death showing that Jesus is also human (5:6, 8), nor are either of these contradicted by the testimony of the Holy Spirit in the hearts of believers (4:13‑15; 5:6, 10), as the false teachers had evidently been claiming (2:20‑27; 3:24‑4:6). The Spirit of Truth confirms to us both Jesus’ divine sonship shown at His baptism, and Jesus’ real humanity shown at His death. The claims of the false teachers, that Jesus was one of the powerful angelic mediators spoken about in popular Jewish religious literature of the day, were inadequate both in their denial of Jesus’ superior divine sonship and unique mediatorial role (cf. 2:1) and in their denial of Jesus’ genuine humanity, and were thus presenting a ‘false Messiah’, an ‘anti-christ’.