In a parliamentary democracy, how is the head of state, such as the prime minister, chosen?

In a parliamentary democracy, the head of state, typically the prime minister, is usually chosen through a process of election or appointment depending on the specific country's political system.

In many parliamentary democracies, the leader of the political party that wins the majority of seats in the parliament or legislature becomes the head of state. This individual is usually the leader of the party and is elected by the members of the party or by the parliament itself.

In some countries, the head of state is appointed by the monarch or president, based on the recommendations of the parliament or the political parties.

Overall, the selection process for the head of state in a parliamentary democracy can vary from country to country, but it is typically based on democratic principles and the will of the people as expressed through the parliament.