These letters were not known until well into the 3rd century. They are not written by the same person either. One copies the other.
2 John is an assertion of growing authority of the orthodox camp, targeting unnamed, but clearly Gnostic type opponents. The crux of the letter is verse 7, where the theology he is defending is laid out.
"For many deceivers (πλάνοι) have gone out into the world, men who will not acknowledge the coming (ἐρχόμενον) of Jesus Christ in the flesh (ἐν σαρκί); such a one is the deceiver (πλάνος) and the antichrist (ἀντίχριστος). "
I chose 4 words here to illustrate exactly what he is talking about.
The word "deceivers" πλάνος has additional connotations of a wanderer (i.e., an itinerant preacher) and imposter --I will come back to this--, which match the targeted opponents he is speaking of. This tells us we are in an era where the church is already settled enough that it is in fixed locations, such as the one unearthed in Dura-Europos. Implied here, and also in the author's self designation as elder (πρεσβύτερος), implies he is the opposite of the itinerant preacher. Also elders (Titus 1:5, 1 Timothy 5:7) were one of the positions least respected by the Gnostics, and a position curiously missing from the Marcionite texts.
The word "coming" is here ἐρχόμενον not παρουσία as we would expect for the (second) coming of Jesus Christ. But clearly that is what is meant, as the word has additional metaphorical meanings to arise, come forth, show oneself. This is a bit of a later theology as the inference is to arise again rather than descend.
A key development is that this coming is ἐν σαρκί "in the flesh", rather than unspecified as in earlier texts. We are not just talking about Jesus being in the flesh during his ministry, but reconstitution of the flesh at resurrection, a position we see in church fathers such as Irenaeus and Justin against the earlier positions that the resurrection was of the soul only, a position held by Gnostics. (Note, this body and soul revival is very much a traditional Greek opinion and not in any way a Jewish one.) The Gnostic view, and modern Christian view (with only a minority holding bodily resurrection) is that of the soul being imperishable, can be found in Paul, especially 1 Corinthians 15, of the imperishable spirit body as opposed to the earthly flesh body. John 20:17 is ambiguous, suggesting even a non-physical body, while the Thomas addition in John 20:27 implies such a physical body, as does Luke 24:39-43. Even the Council of Constantinople (381 CE) ducked the issue, opting to blandly say "we look for the resurrection of the dead, and the life of the world to come." The issue probably wasn't settled at that point. Hence the argument is polemic.
The use of antichrist (ἀντίχριστος) is specifically associated with those itinerant preachers (πλάνος), the very opponents the letter addresses, saying they are the antichrist, because they deny Jesus' coming is in the flesh. This is flipping the Gnostic notion of the antichrist being the Christ of the creator God, who is yet to come (this is how they read the son of perdition, or John's asking if Jesus is the one or they should wait for some other, the some other being the Creator's Christ = the antichrist for the Marcionites and Gnostics). 2 John 7 it is a further development on the concept we see in 1 John 2:22, where the antichrist is said to be someone who denies the father and the son, meaning denies Jesus is the son of the creator (why the Church fathers are always ranting about Gnostics who blaspheme the creator, saying he is not the father of Christ). 1 John does not mention the arisen Christ is in the flesh.
My take away here is the writer is of the opinion these preachers are against Christ because they are teaching a myth, a Christ who doesn't exist, a Christ without flesh, at least in resurrection, or rather in the second coming.
I agree very much with the commonly held position that the letter is addressed to church ("the lady") and the congregation ("her children").
The position (2 John 10-11) that even greeting (χαίρω) or hosting (λαμβάνετε αὐτὸν εἰς οἰκίαν) these itinerant preachers (αὐτῷ = πλάνος here) is guilty by association (κοινωνεῖ τοῖς ἔργοις αὐτοῦ τοῖς πονηροῖς), can be seen as an extremely hard line. The effort here is to completely deny these opponents any opportunity to preach to those of the orthodox controlled churches. The writer instead wants them to "walk" (verse 6, περιπατέω, that is stay on the path or "the way" = ὁδός) by the teaching (διδαχῇ) of the Christ --that is the orthodox view the writer espouses) which the church (the lady) heard from the beginning (ἀπ᾽ ἀρχῆς).
This letter is all about holding church doctrine and keeping Gnostic out. The elder here is not a specific person but an office, the appointed overseer of the church in a given town. Essentially this letter is a directive that the elders to see to it Gnostics are kept out. The coding in this letter is pretty straight forward and obvious. It seems only later the legend of John was attached to the letter.
******************
3 John is clearly after 2 John. Verse 6 and 9 are a dead give away, as he says he has written to the "church" (ἐκκλησίᾳ) rather than the coded "lady". He in fact seems to refute 2 John outright. We here about some Diotrephes, who puts himself as the first, is not speaking for the church but for himself. In verse 10 he says this guy is doing everything suggested in 2 John 10-11
... he himself does not receive the brethren, either, and he forbids those who desire to do so and puts them out of the church.
The author of 3 John in verses 5-8 strongly defends the traveling preachers
Beloved, it is a loyal thing you do when you render any service to the brethren, especially to strangers,
who have testified to your love before the church. You will do well to send them on their journey as befits God's service.
For they have set out for his sake and have accepted nothing from the heathen.
So we ought to support such men, that we may be fellow workers in the truth.
I would go so far as to say the author of 3 John is suggesting in verse 10 that the author of 2 John is Diotrephes (whom 3 John's author says ignores his authority over him - so we have conflicting claims to leadership, such as is hinted at in the Nicene Creed with Alexandria, Antioch and Rome), and that he is unjustly speaking evil of specifically of the doctrines (λόγοις πονηροῖς φλυαρῶν ἡμᾶς) held by the author of 3 John (Note πονηροῖς is the exact same word used in 2 John 11). Almost certainly the author of 3 John is not Gnostic, rather from the orthodox camp, but holds a spiritual resurrection. He supports itinerant preachers (do we have a monastic movement already in view here?) against closed door of the establish church hierarchy -- this is an issue that surfaces again and again for the entire life of the church.
There is no way these two authors are the same. 3 John appears to be in direct response to 2 John. The ambiguity of the Nicene Creed on this issue shows both views were held by orthodoxy. The writers of 2 John and 3 John are rival leaders, merely calling themselves elders rather than the more likely office of bishop they hold (this is not uncommon, even Cardinals refer to each other as simply "brothers")
“’That was excellently observed’, say I, when I read a passage in an author, where his opinion agrees with mine. When we differ, there I pronounce him to be mistaken.” - Jonathan Swift