A rule of law gives people security and assurance that the rules will be followed: this gives them an incentive to follow the rules rather than to rebel or use violence to achieve what they want.
So, if they know that the law will be followed, they will show their interest in voting rather than through (armed) conflict: and this is the basis for democracy.