Most modern republics are based on the US Constitution.
The US Constitution borrows a lot of ideas from Rome and Greece.
This is a painting of the Roman senate. Male property-owning citizens could vote for senators who would represent them in the Roman government.
Before Rome, Ancient Greece was the first major civilization that we know had a democracy. Greece and Rome provided the foundation for democracy and republics.
1) The People have the power. A Republic is a form of Democracy, in which the power of the government comes from the people. Sometimes, like in the United States, this came about as a reaction to monarchy in which one unelected person has entire control over the government and its citizens.
2) Pure Democracy is too unreliable. In Ancient Greece and Rome, the idea of giving every citizen the right to vote was abhorrent to the ruling class. Instead, they kept the average citizen at a distance from the government by greatly limiting who could vote, and then allowing them to vote for representatives instead of directly for government actions. The Framers of the US Constitution wanted to avoid the "Tyranny of the Majority," or the simple fact that 51% of a nation could vote to strip the other 49% of constitutional rights. A representative democracy is supposed to act like a guardrail against the whims of the people. If we elect wise, educated, and thoughtful leaders, the goal is that they will only act on the best ideas.