remconius
Deity
The reasoning is that you can adopt a religion which gives happiness and culture in all cities with that religion. The Religious civics give more benefits to cities with state religion. So the best religion is the one in most of your cities.
The other factor is foreign relations. It could happen that a majority of powerful nations adopt another religion. You can do two things, convert yourself or others. Build lots of missionaries to introduce your religion with them and once there is a fair share in the rival nation, you can ask them to convert or they might convert by themselves. Or you can build a monastery in one of your cities with the global majority religion and convert your own cities to the rival religion, adopt it as state religion and see your foreign affairs skyrocket.
If you have more than 1 religion in your cities you could convert from one religion to the next depending on who you want something from. Especially with spiritual trait, otherwise you find yourself in anarchy.
The other factor is foreign relations. It could happen that a majority of powerful nations adopt another religion. You can do two things, convert yourself or others. Build lots of missionaries to introduce your religion with them and once there is a fair share in the rival nation, you can ask them to convert or they might convert by themselves. Or you can build a monastery in one of your cities with the global majority religion and convert your own cities to the rival religion, adopt it as state religion and see your foreign affairs skyrocket.
If you have more than 1 religion in your cities you could convert from one religion to the next depending on who you want something from. Especially with spiritual trait, otherwise you find yourself in anarchy.