Answer: Modern republics and democratic processes can trace their lineage in many ways to the philosophies and ideas of John Locke, and to the core tenets of the Magna Carta.
John Locke popularized the "social contract" theory, which posits that all human beings possess "natural rights" (basic safety, freedom of choice, etc.), and that government is more or less a "necessary evil" that governs human behavior through one simple mechanism:
According to Locke, governments (ideally) exist in order to protect the natural rights of their citizens. In exchange, their citizens willfully give up some liberties and freedoms, since the government is not functional unless citizens consent.
This leads to the second major concept, which is that the above-mentioned mechanism is a type of "contract" between governments and the governed. The government agrees to guarantee basic natural rights, and the citizens agree to adhere to basic laws and rules. If either party reneges on their half of the contract, the opposing side may take certain punitive actions.
When a person breaks the law and is caught, the government can enact the part of this "social contract" where they are allowed to imprison and surveil this person - a huge violation of "natural rights" under other circumstances. This is because that person has not held up their end of the bargain. Thus, they are not entitled to the natural right of freedom.
On the other hand, if the government has begun to abuse its power by not protecting the natural rights of its citizens (due to corruption, neglect, etc.), then the citizens may revoke their consent to be governed. This is when you see revolutions or coups.
It's important to note that the social contract theory is a type of unwritten law - it refers to the basic, implicit agreement between people who live in a society and the people who create and enforce the rules for that society.
The Magna Carta, on the other hand, is one of the first major documents in modern European/"Western" history to so explicitly put the concepts of "natural rights" and the "social contract" into writing, thus setting a recorded standard for behavior on the part of citizens and on the part of the governing class.
Thus, town hall meetings in the context you have provided are the predictable outcome of new ideas of government which emerged in the Magna Carta, Lockean philosophy, Enlightenment political theory, and modern ideas of the purpose and function of government: Most Western societies have spent the vast majority of their histories under monarchical and/or hierarchical and/or hereditary rule where the consent of the governed was more or less a non-issue. The governed (particularly in lower classes, which is unfortunately stlll the case) had no real say. In the wake of the European Enlightenment, this changed.
Boom - town hall meetings. The reason these meetings existed was because fundamental Western concepts of government had shifted to be vastly more populace-friendly. It was by this point a widely-accepted idea that the governed should have some sort of say in the machinations of the government, PARTICULARLY if they were paying taxes.
Hope that helps you get started!