John's life bridged the seventh and eighth centuries. His father was the controller of revenues for the government in Damascus, and he ransomed an enslaved Sicilian monk to be the tutor for young John. Having received an outstanding classical religious education, John became a scholarly monk when a change in the local government made it distasteful for him to follow his father in the civil service.
The hot religious topic of the day was iconoclasm, the destruction of religious icons. As noted on earlier posts, some felt that icons violated the commandment against graven images. Zealots, both Christian and Muslim, felt compelled to destroy the icons held by others. Often it is not enough to follow the commandments; one must also force others to follow the commandments, on pain of death, if necessary.
Like many monks and priests, especially those classically trained, John felt that icons served valuable roles in religion -- they were instructional tools, reminders & prompts for reverential thoughts, and focal points during worship. The defenders of icons did not believe that the objects were gods or should be prayed to, but the fear that they might be idolaters drove the iconoclasts to violence.
Now here's the interesting part. John wrote tracts against iconoclasm. The Emperor, a dedicated iconoclast, usually punished his critics and opponents with prison or even death. But John was living in Damascus, which was by that time under the Muslim caliphate. Of course the Caliph was also an iconoclast, but as long as John paid the poll tax levied on non-Muslims, he was more or less free to write what he wanted.