A meritocracy is the condition where people who deserve to can go up in rank, as opposed to a system like nepotism. It applies generally to all positions to which people may be appointed. It often reinforced by laws, such as that women should have equal opportunities to men in employment.
The philosopher Plato thought that a government based on merit was better than democracy. In democracy, there is no guarantee that you will get the best person, the most qualified person, ruling the state. His criticisms were really of Athenian (or direct) democracy, where anyone could be selected to rule.
In a meritocracy, the people are chosen who are thought to be the best. Some have accused it of being elitist, saying that government by the best will mean that only those who have had the right opportunities will have a chance to govern, creating in effect a ruling class.
It is worth pointing out that Plato didn't see it this way. He believed that philosophers were the best people to rule because they were disinterested, meaning they only had the interests of the state in mind, not their own interest. Plato's point was this: if you want to rule, then it will go wrong, because power will corrupt you. If you are a philosopher, you don't care about power – all you care about is truth, so you will rule well, without being interested in your power or status.