John, “the apostle of love”, wrote these letters from the city of Ephesus, where he spent the latter years of his life.
There were false teachings which arose within the church, and though the false teachers had then departed, the Christian community continued to be divided in their understanding and practice of the faith. So he wrote both to warn against those things that may work against the church, and to encourage the believers in their loyalty to the Christian faith.
Purpose 1 John was written to help believers in their walk with God who is Life, Light and Love. In chapters 1 and 2 John focuses on fellowship and contrast saying and doing. In chapters 3 to 5, he emphasizes sonship (being children of God). John warned about false teaching concerning the Person and work of Jesus Christ. False teachers had infiltrated the church denying the divinity and the incarnation of Jesus. John affirms the true identity and mission of Jesus Christ.
"And this is the testimony: God has given us eternal life, and this life is in his Son." (1 John 5:11)
In 2 John, the apostle, concerned that after their defection the false prophets might spread their teaching in other communities of faith, then wrote to warn believers. The recipient of this letter, referred to as the elect lady, was known for her hospitality towards visiting teachers. John wrote her to warn her against receiving false teachers.
"If anyone comes to you and does not bring this teaching, do not take him into your house or welcome him." (2 John 10)
In 3 John, he wrote to commend, encourage, and instruct his good friend Gaius. John focused on making God’s truth a vital part of life.