Contemporary Western perception of Buddhism seems to center around 'New Age' distillation of it and the Dalai Lama, but obviously historical Buddhist states had to maintain militaries. Further, I also recall monastic orders with monks that trained for combat (at least in Japan). How did this fit into Buddhist thought, for both the monks personally training for combat and society at large fielding military forces?
Whenever discussing the sociology or political interaction of Buddhism it is important to take a clear look at what "Buddhism" actually is. While in the west we tend to focus on the abstract philosophical tenants of the religion, this focus is almost irrelevant to average person practicing Buddhism. If you took a look at the most typical manifestation of Buddhism in China and Japan you would see a layman (non monk) making offerings at an altar and/or rhythmically chanting scripture. Their motivation would be to increase their fortune in this life, improve their lot in their next life or venerate their ancestors. That is what Buddhism actually is for the vast majority of its practitioners. For this demographic, abstract ideas of non violence are simply not an important issue and foreign to their actually practice of the religion. A more "elite" demographic of the religion would be monks and they would be much more aware of the abstract teachings of the religion such as not causing harm. Its important to understand that for people who took the spiritual practice of Buddhism seriously they for the most part interacted with the religion as an activity of personal liberation not as a recipe for how to run society. A monk was a person who took certain vows, such as non violence not to improve society but to further their own personal path to enlightenment. That is the ideal, but most monks, especially senior ones were very focused on more mundane matters such as curing favor with military leaders to insure funding and legitimacy for their own religious lineages. Aside from a few important enough individuals, most abbots put their energy into kissing the asses of leaders, not admonishing their military actions.
And then at the extreme you would have monks who actively promoted or even participated in violence. How did they justify this? Now you run into the great human capacity to justify almost any behavior through twisting logic in any way they need to.
Here are some examples from WWII Japan:
"[If ordered to] march: tramp, tramp, or shoot: bang, bang. This is the manifestation of the highest Wisdom [of Enlightenment]. The unity of Zen and war of which I speak extends to the farthest reaches of the holy war [now under way]." - Harada Daiun Sogaku
"Showing the utmost loyalty to the emperor is identical with engaging in the religious practice of Mahayana Buddhism. This is because Mahayana Buddhism is identical with the law of the sovereign." -- Seki Seisetsu
"I wished to inspire our valiant soldiers with the ennobling thoughts of the Buddha, so as to enable them to die on the battlefield with confidence that the task in which they are engaged is great and noble. I wish to convince them.... that this war is not a mere slaughter of their fellow-beings, but that they are combating an evil." -- Shaku Soen
"In the present hostilities, into which Japan has entered with great reluctance, she pursues no egotistic purpose, but seeks the subjugation of evils hostile to civilization, peace and enlightenment." -- Shaku Soen
"It is just to punish those who disturb the public order. Whether one kills or does not kill, the precept forbidding killing [is preserved]. It is the precept forbidding killing that wields the sword. It is the precept that throws the bomb." -- Sawaki Kodo
Basically, your question is based on the false premise that a "Buddhist society" would be a peaceful one where nobody causes any harm. That is pure fantasy.
Most of the old kingdoms in and around India that patronized Buddhism also had top militaries, such as the Parthians, Kushans, and Satavahanans. These kingdoms were not strictly "Buddhist," though, and sometimes patronized other religions. Different Indian rulers patronized different religions, or even more than one. These could include temples for different schools of Hinduism, Jainism, and Buddhism. These religions vied with each other and competed for patronage through proselytizing, debate (using formal logic and rules), and through the writing of philosophical treatises to systematize their own religion (or to provide an extensive criticism of another religion or philosophy). If you want to learn more about the actual situation in India, you can read the travelogues of Faxian, Xuanzang, and Yijing, who were all Chinese Buddhist pilgrims who spent years traveling around India and describing all the practices there. Rulers still patronized the temples they wanted to, and no monks would dare lecture them about having a military.
Even in early Buddhism, the cakravartin king (universal monarch who unites all countries into one empire) was the ideal ruler, whose land consists of everything his chariot rolls over. That type of king still has a military and may go to war. Buddhists had no illusions that kings would become entirely peaceful and non-harming. After all, the regulations even between monks and laypeople are extremely different. Monks were expected to practice non-harming and were governed by hundreds of regulations (pratimoksha rules). By contrast, laypeople had very few regulations, and many of them were and are still ignored. In more conservative forms of Buddhism, even monks eat meat. They just buy their meat from a butcher, and the butcher is regarded as taking on the evil karma caused by killing the animals. In Thailand today, a butcher still has this stigma, even as he butchers animals that will be turned into meat and sold to temples for use in soup.
However, there is one instance that I can think of in which a Chinese ruler, Emperor Wu of Liang, was very impressionable and attached to the Buddhist monk and translator Kumarajiva, who was from the state of Kucha. This monk was able to influence Emperor Wu to treat his enemies with compassion, and ban capital punishment. This worked poorly, his kingdom was eventually plunged into chaos. Emperor Wu was captured and he died a terrible death of starvation. Confucian historians generally looked back upon him with a certain amount of scorn because he failed to protect his own state.
Surprised nobody had mentioned Asoka. Prior to the Emperor Asoka's conversion to Buddhism in the 3rd century BCE Buddhism was effectively a localised cult (I.e. not an established, organised, religion) that existed in a relatively small area of northern India and what is today the Nepali Terai.
At this point Buddhism also appears to have been more idealised - largely because the teachings of Siddartha Gautama had yet to be tested by the strains of existing within a major and institutionalised religion.
Asoka's conversion and subsequent missionary work saw Buddhism transformed from a local cult to a religion that covered the entirety of the Mauryan Empire. Missionaries and Emissaries introduced Buddhism to Sri Lanka and Burma - countries that are predominantly and officially still Buddhist today.
However, the expansion of Buddhism also saw Buddhist monasteries becoming closely linked into trade, the gathering and redistribution of surplus, the administration of agriculture and irrigated landscapes - and politics. This runs counter to the teachings of Siddartha, but also gave the monasteries wealth, power and influence.
In India the fall of the Mauryan dynasty saw Buddhism gradually attenuated as Hinduism returned to primacy. However, in kingdoms like Rajarata (Sri Lanka) and Pagan (Burma) the secular monarchs derived legitimacy from their role as defenders of the faith, defenders of their Buddhist nations. Consequently, conflict with neighbouring states (especially non-Buddhist states) was common and accepted. In Sri Lanka we see tit-for-tat invasions by the Rajarata kingdoms against a series of Indian neighbours (Pandyan, Cola etc).
More recently, in the 20th century, we see political parties in Sri Lanka and Burma who are either formed by, or very influenced by, Buddhist monks - and who are typically what we would recognise in the West as hawks.
The short answer is that Buddhism as an organised religion is comparatively divorced from the actual teachings of the Historic Buddha, just as Christianity in practice is removed from the teachings of Jesus as an individual.