It may seem like democracy always ends up with suboptimal laws but its more a function of the people in the democracy than the system of government.
The resulting set of laws being suboptimal is a matter of probability and depends on the people making the laws. As a democracy can make sub optimal laws, a king has the same chances or even more to make a set of sub optimal laws.
In the other way, it's possible for the people in a democratic nation to choose optimal laws also. A group of people may not always end up going for the most acceptable version. There are people who give up their lives for the common good like our patriots and in the same way there are people who compromise their B and C for the good of D and E.
Comparing democracy and dictatorships for example, democracy tries to minimize the amount of dissatisfaction in the laws being enacted. So even if it isn't optimal, chances are, you won't end up living under laws you don't like.
And the way to make perfectly optimal laws is a meritocracy where we choose a ruler based on how good he is as a ruler, but unfortunately we don't have any standardized tests for that and the best we have found so far is democracy, trusting the wisdom of the crowds.
So in the end, the pros of democracy is that
- Probably the wisdom of crowds is more than any random person
- If the laws end up sub optimal, hopefully you won't end up living under laws you don't like. So it's trading efficiency for the maximum amount of satisfaction.
A way out of this seems like educating people and empowering them so that, in the end, the probability of a sub optimal set of laws are decreased.
Some more thoughts based on Revious' comment about how democracy ends up with sub optimal laws and about long time periods for change.
This phenomenon where A and B are accepted and the rest are neglected is actually a feature of democracy and not a drawback.
How democracy is supposed to work is, first there is a proposal, which goes through stages of dissent, discussion and ends with consensus.
In a perfect democracy it should always end with a consensus which we reach through education and informed discussion. In the real world, when this doesn't happen, or when we are pressed for time, we have a fallback called voting. In theory, voting should be the last resort and consensus should be seen as the first option. The end result of a perfect democracy is actually consensus and not rule of the majority or voting.
In the question, when only A and B gets passed, what is happening is that, the system, or democracy is producing consensus. We can see that those are the two laws with a unanimous consent and those are the laws that gets passed. In a fully formed democracy, this is the expected outcome. The system makes sure that only those laws with consensus gets passed and will put the rest of them, the ones without a consensus to a pause, it won't get enough support to pass, until all the actors can reach some kind of consensus. Something analogous to the efficient market theory of economics. So, as we make democracy stronger we end up getting closer to consensus even if we don't plan for it.
There's always the story of how the majority dominating the minority but that happens only in a partial or weak democracy because such a clear cut segregation of an issue happens only when a lot of the voices or actors are silenced.
When we can't reach a consensus on some issue, it is put on pause and stays like that until there is a consensus among the actors and this may take a very long time sometimes. We can make it faster by making use of better methods like using newer technology for discussions and voting, like taking them online which is one simple crude example.
Even so, we don't always need to make decisions so fast or in a haste. Will Durant once said that
But where a hundred million destinies maybe involved, four wheel brakes may be advisable even when going uphill. Large bodies must move slowly
And when the general public collectively wants something bad, like a short sighted solution? It is the will of the people and there is no stopping it, whatever form of government we may have. In a democracy we can try a hand at educating the people and manufacturing consent. In a dictatorship even with a benevolent monarch, we end up going through tyranny, revolution and conflict.