Background- John is writing to his friend, Gaius, who is a leader in the church. He praises and encourages him on the good work he is doing along with condemning another man by the name of Diotrephes for going against his (John) teachings.
Gaius that John speaks of was probably the pastor of the church or if not the main layman. He is not fully identified as to which Gaius he is. There are a few mentioned in the following passages; Acts 19:29, Acts 20:4, 1 Cor 1:14, and Romans 16:23. Whoever he was John was very excited to hear that he was a man of integrity and following the truth. John also showed great admiration that the church members were walking in truth as well.
Even though in 2 John John spoke warnings against being hospitable to travelers, here he is praising Gaius for doing that very thing. I am assuming that Gaius had a reputation for discernment to know who was really a true believer. It says in verse 6 that these strangers would testify in front of the church about his hospitality and godly manner.
John calls out Diotrephes for being a man of pride and putting his own interests before the church. Like Gaius it is unclear as to what role Diotrephes really has in the church. It is thought that both men were probably head pastors over this particular church. In verse 10 it is said that he doesn't show hospitality toward any of the missionary travelers and even forbids them in a way from attending their church. He has made himself a dictator over the congregation according to what he thinks is right.
John praises Demetrius for his moral integrity like that of Gaius. Demetrius was probably the one who delivered the letter to Gaius. As in 2 John, John doesn't want to write anymore because he hopes to visit them soon in person. The way John words his final remarks in verse 15, "the friends greet you", he was probably surrounded by Christian friends who want to say hello to Gaius as well.
* It stood out to me the most in this passage that when two men with very different approaches toward the church take charge of the church how unstable a church can be. Even though there were members who were following the truth, there were probably just as many doing the opposite like Diotrephes. My prayer is that we follow the ways of the Lord and not man.