What are the common/main mechanisms to appoint judges in different western countries? How is the head of the judiciary system elected?
This is probably a bit broad, so my answer is probably going to lack some detail. See "APPOINTING JUDGES THE EUROPEAN WAY" for those, from which I've excerpted the quote below. TLDR version: generally continental Europe (except Eastern Europe) has a civil service model for judges (roughly judges go to a school for judges and qualify be exam) except for constitutional courts for which a more political (shared appointment) process exists; in the latter process some of the appointments are made by political bodies (e.g. legislature) and some by the professional (judicial) ones.
Continental Europe devised three models for naming judges: civil service, shared appointment, and shared appointment with partisan quotas. In many of these nations, there are two or even more types of courts, each with a different mode of appointment. For example, Italy, France, and Germany all use a civil service model for the ordinary and administrative courts, but use shared appointments with political quotas for the constitutional courts. The civil service model and the much later constitutional ones that are separated from the judiciary can both be traced to Napoleonic France, but were subsequently adopted and adapted across much of the continent. [...]
This civil service model, begun under Napoleon, has been widely imitated across continental Europe and consciously demarcates a separation between law and politics. Emphasis rests on pragmatic knowledge and non-interference in the political process. Therefore, most civil law countries have systems in which the largest number of magistrates (a term used to connote both judges and prosecutors) are recruited directly from among young university graduates who score well on competitive examinations. Most training is on-the-job, under the supervision of more senior judges. The absence of any professional experience outside of the judiciary also allows for strong socialization within the judicial corps and a clear separation between the bench and the bar. Two recent changes have, however, affected the process. More lateral entry into the judiciary by experienced lawyers now occurs and judicial schools, like the one begun in France in 1958, now train judges in Greece, Spain, and Portugal. [...] With some variations on the theme, the civil service model for appointing judges can be found in Austria, Finland, France, Germany, Greece, Italy, the Netherlands, Portugal, Spain, and Sweden. Notably, it was not the choice for the post-Cold War democracies of central Europe. [...]
A shared appointment approach to naming judges is found, at least in the European context, where there are constitutional courts. Constitutional courts are modeled, as mentioned earlier, on the pre-World War II Austrian example, and their creation constituted a conscious rejection of the U.S. model. These courts are separated from the ordinary and administrative judiciaries and are co-equal with the executive and legislative bodies. They exist solely to apply and interpret the constitution. Both Italy and West Germany first adopted constitutional courts in their post-war constitutions, and Spain and Portugal did likewise when they emerged from dictatorial regimes. Luxembourg has recently adopted one, as have the Czech Republic, Slovakia, Slovenia, Lithuania, Latvia, and Hungary. [...]
Cases do not reach the European constitutional courts through an appellate process, as they do in the United States. Rather, they are referred, usually by judges hearing cases that raise issues of constitutional interpretation, to the constitutional bodies for a definitive interpretation that sometimes requires that a law or other official action be annulled if it is deemed to conflict with the interpretation of the constitutional court.
Constitutional court judges are typically named through a process of shared appointment. When judges on ordinary courts have a role in appointments, bridges are created between the ordinary courts and the constitutional court. For example, in Germany, eight of the sixteen constitutional jurists must be chosen from among judges on the highest courts, and in Italy, five of the fifteen constitutional jurists are appointed by the judges of the ordinary and administrative judiciary. In a system of shared appointive authority, partisan politics may or may not play a role, though it usually does. In Italy, for example, even those judges named by the ordinary judges tend to reflect the relative power of the various judicial unions. Five others are named by Parliament in a joint sitting of the two houses and five are appointed by the President of the Republic, a largely ceremonial official who represents national unity. Those named by Parliament and in practice by the President of the Republic were, for forty years, apportioned among the parties according to a negotiated formula. Until 1994, that formula allowed for two positions for the Christian Democrats, one each for the Socialist and Communist parties, and one to be rotated among the lay parties.When the old Italian political party system collapsed in 1994, there was no agreed upon allocation, and nominations were decided by a vote of the two houses in a joint sitting. The result was that a number of vacancies were not filled through 1995, but when they were finally filled, they tended to follow the general lines of the previous system.
Judges on the German Constitutional Court are also selected through a shared appointment system with clear partisan quotas. The two houses of the German Parliament, the Bundestag and the Bundesrat, select the judges, but six of them must be selected from among judges sitting on the highest ordinary and administrative courts. The German Constitutional Court is divided into two senates, each having different jurisdictions, and judges are appointed to a specific senate. The directly elected Bundestag uses a judicial selection committee to make all of its appointments, whereas the Bundesrat, representing the states or lander, involves the entire chamber in electing judges. A two-thirds majority vote is required for selection. Because the two-thirds majority can lead to a stalemate, each of the two major parties have informally agreed to each get one-half of the judgeships in each senate. The minor parties obtain their representation on the court through the allocation of the major party with whom they are in a coalition. Thus, the Free Democratic Party and the Green Party usually “secure a seat from their larger coalition partner when they are in government.” Since German Constitutional Court judges serve one non-renewable twelve-year term, when a judge retires “the party with ‘property rights’ over the seat can choose the re placement (subject to an informal norm against choosing extreme candidates).” [...]
Though the French Constitutional Council stands as a unique hybrid institution, created in 1958 to protect the executive from a potentially non-acquiescent parliament, it has evolved into the weapon of last resort for the parliamentary opposition. It is not a court, per se, and could not be in light of the 1791 prohibition on a judge’s invalidating any law. Therefore, the constitutional validity of a law can be judged in the Council in the abstract, divorced from any concrete fact pattern, before it is enacted into law. Any law can be referred to the Council by the President of the Republic, the Prime Minister, the Presidents of the National Assembly or the Senate, or by sixty senators or sixty deputies before it is promulgated into law. Whereas other constitutional bodies struggle to demonstrate that they are legal rather than political institutions, the French Constitutional Council is overtly political, staffed by politicians for whom the primary criterion for appointment is partisan affiliation. Three of the nine counselors are appointed by the President of the Republic (not a ceremonial figurehead), three by the President of the National Assembly, and three by the President of the Senate; in addition, all former presidents of the republic serve for life. “Legal credentials or experience are not required, though so far, those nominated have had them.”
To find an example where shared appointment does not carry at least a hint of partisan quotas, one must look to the supranational courts in Europe. The European Court of Justice (“ECJ”) governs all interpretation of the EU treaties and, through a referral process involving the courts in the member states, determines when there are conflicts between national laws and constitutions and the treaties. The ECJ is composed of twenty-five judges, one for each of the member nations. The European Economic Community Treaty provides that the judges shall “be appointed by common accord of the Governments of the Member States for a term of six years.” Although there is no nationality requirement, “there is an unwritten rule that one judge will come from each member state.” The judges are proposed by their nations of origin, and rarely are nations’ nominations disputed. Only those who are qualified to be named to the highest courts of their home nations can sit on the court. The extent to which appointments are rotated among parties or reserved to the majority party reflects the appointing country’s political culture.
In the UK, judges are appointed not elected. Appointments are made by the Lord Chief Justice on the recommendation of the Judicial Appointments Council which is tasked with making appointments of people with "good character", on merit, while giving due attention to diversity (including professional diversity, as there is an attempt to appoint more solicitors as judges). The JAC is composed of mixture of judges, lawyers and lay members (typically senior academics, military officers and other eminent people).
The Supreme Court of the UK, (which handles both Scottish and English cases) has its members appointed by a commission that is formed from members of the court, the JAC and its Scottish counterpart. The commission's recommendation is then considered by the Lord Chancellor (a government minister), who may reject the recommendation or ask the commission to reconsider. If the Lord Chancellor approves the recommendation, the appointment is made by the Monarch under the advice of the Prime Minister.
The Lord Chief Justice is likewise recommended by a specially formed commission, and the appointment is made by the Monarch on the advice of the Lord Chancellor and Prime Minister.
The Lord Chancellor is a Cabinet position, appointed by the Prime Minister, and the Queen is of course selected by birthright.