Why do some countries have prime ministers, while others have presidents?
Well that depends on the type of government in the country
Some countries have decided on electing a president who will have all the power while others have decided on electing a PM. For example, USA has a presidential form of government where the President has been vested with a lot of power. On the other hand, in Britain we have a PM who is the real head of the State while Queen is just a nominal head. In India, we have both President and PM, but the powers of the PM substantially exceed those of the President
So it's just a matter of choice. Whatever is in the constitution of the country, will be implemented
Hope it helps :) :)