If you want to be the prime minister, you need to be a military first. And then you do the coup d'etat. Now, you can manipulate all the laws that can give you advantages in the real election.
Did you hear about the election in Thailand that was done by nasty disgusting Prayuth Hua Kuai? I heard that the sum of all votes exceed the number of people who voted.