There are two sides or more to an election - the winning side will get what it wants (hopefully) the losing side will not. What are some of the ways both sides can benefit or do they have to wait 4 years or 8 years for a swing in their fortunes?
First, there is no absolute protection for the losing side (nor for the voters on the winning side) because any system of government ultimately depends on the behavior of the people, particularly the people with guns.
Having said that, in America there are a number of protections for the losing side such as:
- The fact that in a few years there will be another election. The winning side may not get all of the same voters again and will not want to make the voters who didn't vote for them this time continue to be unwilling to vote for them next time.
- "Separation of Powers" between three branches of government - the Executive, Judicial, and Legislative
- A system of "Checks and Balances" that allow members of a branch to restrain the behavior of other branches. Well-known examples include the veto and Impeachment
- A list of enumerated powers that give the national government a limited set of powers that it can exercise while leaving other decisions to the states or the people. America has a federal system of government in which power is divided between the national and state governments.
- A bill of rights that lists actions that the government specifically may not take, most of which are designed to prevent abuses by the government.
- When not talking about rights but simply rather the winning side will "get what it wants", the American Senate has a filibuster that requires a supermajority to overrule. Major laws in America have to be approved by the Senate and the filibuster allows a minority to stop a law from being passed (I say "major" because there are many federal regulations enacted that have the same effect as laws but do not require specific Congressional approval because at some time in the past Congress empowered the executive branch to create them unilaterally). In the recent 2016 American election the Republicans gained a majority in the Senate, but not enough of a majority to end a filibuster. They will therefore need at least a few Democratic votes to pass a law. They could get rid of the filibuster with a simple majority vote but neither party wants that because they know that they will be in the minority again someday.
Of course all of this ultimately depends on the willingness of people both in and out of government to respect the process and follow the laws.
In the United States, there are multiple levels of government and overlapping terms. From the 2016 election, the President and both legislative chambers will be the same party (also the Supreme Court after the next justice is appointed, presumably in January). But in two years, that balance could change in the House and conceivably the Senate (although the Senate doesn't have much room to move in 2018). This happened in 2010 (House) and 2014 (Senate). The party that lost the presidential election gained in the legislative branch.
The states also have executives and legislatures that may be up in 2017, 2018, or 2019. They may already differ from the federal result (e.g. West Virginia just elected a Democrat as governor). They may enact their own policies, some of which contradict the national policies. For example, California had tougher environmental laws even under Republican presidents.
And municipalities have their own governments. Most cities elect Democrats, even in Republican years.
Other countries may have similar systems. Also, in parliamentary countries, it's usually coalitions of parties that form a government and control the executive. The coalition can dissolve and force a new government to form even if there is no election. The existing legislators just realign into different divisions.
Constitutional rights and rule of law
In a democracy, a group that has a sufficient majority will be able to pass the laws that they wish. These laws will apply to everyone. The main factor that protects the interests of the losing side and differentiates it from a pure tyranny of the majority is a solid set of constitutional rights that limits the laws that can be passed.
For example, in a well-functioning democracy the winning party would not be able to pass a law revoking voting rights of the minority group. They would not be able to pass laws that clearly discriminate against the minority group, or make employment or financing conditional on voting for the ruling party. They would not be able to pass laws to put the undesirable minorities in concentration camps and exterminate them. They would not be able to pass laws allowing extrajudicial lynching by the majority. If they tried to pass such laws, they would be revoked by an independent judiciary branch.
There are many "democracies" where the aforementioned factors don't apply. I wouldn't call them democracies - performing a 'ritual of voting' is not sufficient for that.
In the United States, the people (whether in a majority or a minority) have the ability to defend their own rights. If sufficiently pressed, by force of arms.
During the American Revolution, the colonists defended their rights by force of arms. The Bill of Rights codified some of these rights, but did not limit them. For example:
Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.
A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed.
No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to be prescribed by law.
The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.
No person shall be held to answer for a capital, or otherwise infamous crime, unless on a presentment or indictment of a Grand Jury, except in cases arising in the land or naval forces, or in the Militia, when in actual service in time of War or public danger; nor shall any person be subject for the same offense to be twice put in jeopardy of life or limb; nor shall be compelled in any criminal case to be a witness against himself, nor be deprived of life, liberty, or property, without due process of law; nor shall private property be taken for public use, without just compensation.
In all criminal prosecutions, the accused shall enjoy the right to a speedy and public trial, by an impartial jury of the State and district wherein the crime shall have been committed, which district shall have been previously ascertained by law, and to be informed of the nature and cause of the accusation; to be confronted with the witnesses against him; to have compulsory process for obtaining witnesses in his favor, and to have the Assistance of Counsel for his defence.
Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted.
These rights mitigate the risk of tyranny. As long as these provisions are followed, the public will know whom the government wishes to punish, and why. People (whether in the majority or the minority) will be able to be armed, trained, and organized. They will know that they are not alone.
In a perfect democracy the elected leaders care for the whole nation and as such further the wellbeing of everyone whether they voted for him/her or not.
In reality it differs very much because not every democracy is alike. Many do have several institutions in place that share some of the power of the elected leader. House of commons, house of lords in UK; congress in the US. Not always do those institutions have the same agenda as the leader and care about other parts of the population.
And as is often the elected leaders don't even care about those who voted for them. Sometimes those who have least to gain according to a party's program/manifesto are those who vote for that party. An example is the right wing AfD in Germany who want to make life better for the rich and get their votes from the poor because their populism and racist propaganda attracts people who don't take the time to read the program/manifesto.