Tradition has it that this letter was written by the Apostle John, possibly to believers in Ephesus, where he might have lived for some time. The letter itself says only that the writer knew his audience well and that there was a theological dispute that had split the church.
The cause of the split seems to have been around denying that Jesus was a real, physical person and that he is the Messiah (4:1-3). The split must have been bitter, as the letter repeatedly commands the believers believe in Jesus as the son of God, stop sinning, and start loving each other as they should.
The command to love each other wasn’t new: it had been there ‘from the beginning’, and doing it was the sign of eternal life:
1 John 32:14-25 If we love other believers, it proves that we have passed from death to life. But a person who has no love is still dead. Anyone who hates another believer is really a murderer at heart. And you know that murderers don’t have eternal life within them.