So, what ultimately happens is:
Religions born as a localized small set of beliefs, cults and tales.
Religion became an important affair of kings and emperors.
Religion differences leads to wars.
Wars makes people be forcefully converted, or killed, or expelled or enslaved or simply marginalized.
Missionaries spread their religion, and the most well-structured religions tends to overthrow less-structured religions.
Religions that teaches and rewards people who act being good and just are more successfully than religious who tells something different.
People from different religions might be kept in the same country because this might be useful or because eliminating one of them might not be worth the trouble.
In advanced cultures, ideology might replace religion or be a complement over it.
The long detailed answer
In the initial stages of evolution, religions became a series of small, inconsistent and highly localized set of beliefs, cults, doctrines and tales, possibly being passed orally from one generation to another. Most of them are polytheistic and tends to personalize things from human psychology or from nature as god-like entities. Many of them tries to provide a divine explanation to otherwise unexplainable phenomena.
Some religious tends to be more monotheistic, although there is no 100% monotheistic religion as far as I know. Those religions features a fully-benevolent almighty creator god, but also features lower classes creatures like angels, devils, demons, saints, spirits, semigods, etc.
Religions tends to be deeply entrenched in politics right from the stone age to the present time and the foreseeable future. In the initial stages, kings are devised as godly or semigodly creatures or perhaps as humans chosen by some divinity, and this is useful to ensure their authority over the people they rule (this is what happened in ancient Egypt and in many Mesopothamic city-states, for example). However this also motivates a lot of bloodshed and wars.
You ask why would a population convert pacifically. Mostly won't. Human history are full of religiously-motivated wars and crimes right from the stone age to present day everywhere in the world. All the major religions existing today had at least on some part of their history motivated marginalization, killing, expelling, enslaving or somehow persecuting non-followers. Also, all of them always had been deeply entrenched with the politics of kings and emperors.
This is also why many people abandon their original faiths. Many of them are killed after being defeated by the enemy who have a different religion. Others are enslaved or marginalized to an extent where it is hard to pass their older religion to their children, especially if priests are killed or expelled and if practicing the older religion becomes forbidden in the favor of newer one. Some people also endure forcedfully conversion.
Sometimes a country might have more than one religion. This might happen when the practitioners of some religion X are more useful alive to a king that practices religion Y, but they can't be converted. For example, this happened in Egypt during the Jewish Exodus and also happened to Christians in many (but not all) Muslim countries. However, the followers of religion X are still unlikely to have full citizenship, being possibly marginalized, persecuted, overtaxed or enslaved. Sometimes, the absence (possibly due to death) of the king in a kingdom where there are more than one religion and neither one is dominant over the other might lead to religiously-motivated civil wars.
This issue advances even in modern times. There are cases of violence between Catholics and Protestants in Ireland. Muslims in the USA may be marginalized and discriminated by the predominantly christian population. The abominations that Jews suffered in Nazi Germany are a clear example of religious intolerance. The Israel-Palestine problem is also something that could be defined as a long-lasting case of a religiously-motivated civil war. The rise of ISIS/Daesh is also a case of faith-motivated war.
And, ISIS/Daesh is also an example of what happens when an area and the people living there are dominated by a group with different religious beliefs which are intolerant to other religions: war, killings, forced-conversions, marginalization of non-practitioners and a lot of people fleeing.
On the other hand, in many places, like Ottoman Empire (present day Turkey), even if the rulers were officially Muslim, Christians were tolerated because persecuting them too much would only create a mess that would make the country too unstable for the king/emperor/sultan be able to rule it peacefully. They were much more useful being tolerated instead.
So, one of the major ways that religions spread is by war. Other is by religion-based politics that favors one religion over the other. Still another way is due to the work of missionaries.
Religions may also be able to grow by missionaries and by propaganda. In the case of missionaries, this was what spread Christianism in the first, second and third centuries despite the roman persecution. This was also what spread it to the indigenous Americas centuries later. Also, in this case, the complex and highly structured and highly traditional Christianity easily overcame many (but not all) of the simpler poorly-structured endemic orally-passed indigenous religions. This happens because those more complex religious are more likely to have more determined and well-trained priests, which are more likely to convert people. This also is the main mean in which people might be converted pacifically.
Also, most successfully religions tell people to be humble, good, merciful, forgiving and generous. This is because most of them promises rewards for people who live like that in afterlife, while promising punishment for people who live against that. This works better to convert people who are poor and helpless, and also makes the states and their rulers more safer than religions that tolerate evildoers. This is one of the causes why Christianism eventually overthrown Paganism in the Roman Empire. The nature of the afterlife rewards also matters, which allowed Islam to prosper in the Arabic desert and easily overthrow Judaism, Christianism, Zoroastrianism and polytheistic religions present there at the time. And again, afterlife rewards and the orientation of being good also was successfully in converting people from less-structured religions, which was what happened in many indigenous places in the Americas.
Also, the tone of propaganda and the speaks of the missionaries is very important to what potential believers want to believe for their our lives. Again, this was important for the spread of Christianism and Islamism, but can also be seen even in Scientology, Pastafarianism and even some crazy flying-saucer-venerating history-channel-like cults.
As a counter example, this explain why Christianism was not successfully in China, since its teachings seemed to be alien-like and strange for most Chinese people who already had a very complex set of different beliefs. This also shows why Islamism failed to spread to Europe since they were not desert people and the already present Christianism made much more sense for them. I.E. the alien-like nature of the foreign religion and the complexity of the already established religion made the foreign religion unable to penetrate.
Also, some religions may be derived from other older religions due to innovations by preachers and by importing traditions and cults from different religions. This is what made Christianism evolve out of Judaism. Also was what motivated Protestantism split off Catholicism. Religion mixing is what gave the rise to Spiritism and Mormons.
And of course, if a king have different religion thoughts than his predecessor or changes its own religious thoughts during his kingship, this might affect the state religion. This is what made the Anglican church split off the Catholic church. This also happened sometimes in ancient Egypt. This was also a reason that made the Roman Empire turn into a Christian empire and ultimately cemented Christianism in Europe and North Africa (although North Africa would become predominantly Islamic a few centuries later).
Also, sometimes an ideology might replace religion. This is something that leads to:
Totalitarism - the belief that the state is responsible for everything as the only way to ensure survival against an hostile world. This is what happened in Soviet Union, in Cambodia with Khmer Rouge and happens in present day North Korea. A weaker form of this flourished in China but was already replaced by a still somewhat authoritarian but definitively non-totalitarian regime.
Social-Darwinism - the belief that weak countries should subdue to global powers, which was used by the UK to justify many of their actions messing with other parts of the world in the 19th century.
Nazism - the belief that a particular race is superior to some other inferior race which is responsible for all the problems, needless to say how horrible this was and what was the result.
Colonialism - The belief that some territory should be exploited for the benefit of some other territory. Practiced by Portugal, Spain, Netherlands and some other countries from the 16th to the 20th centuries.
Exploitative imperialism - A newer form of colonialism, which is the belief that weaker countries are inferior and should serve stronger superior countries, which is what USA made to Latin America during most of the 20th century and arguably still does or tries to do and also what Japan was trying to achieve in WW2.