The Church of Scotland is the established national church of Scotland. (It does not regard itself as a "state church", having fought for centuries to prevent government interference in its affairs.) It is commonly known as the Kirk (Scots for church). The Church of Scotland is Presbyterian, not Episcopal, and should not be confused with the Church of England, the Church in Wales, the Church of Ireland nor the much smaller Scottish Episcopal Church, all of which are part of the Anglican Communion. Both the Church of Scotland and the Scottish Episcopal Church are Churches of the Reformation. The latter is a Sister Church, not a daughter church of the Church of England.
The Kirk traces its roots back to the original Celtic Church in Scotland (6th and 7th century). The Church broke with Rome and adopted Presbyterianism in 1560, in a process of protestant reform known as the Reformation and led, among others, by John Knox. It reformed its doctrines and government on the Presbyterian principles of John Calvin which Knox had been exposed to while living in Switzerland. In 1560, the Scottish Parliament adopted Presbyterianism as the form for Scotland and set up a structure to implement it. However while Parliament was supportive of presbyterianism, subsequent monarchs were not. Over the next hundred or more, years bishops were imposed on the Kirk from time to time. In 1638 a National Covenant was signed by large numbers of Scots in protest at this. These people, the Covenanters, were persecuted as a result.
In 1690, as part of the Glorious Revolution, the Revolution settlement put a stop to this and finally the Scottish Parliament guaranteed the Reformed, Established, Presbyterian nature of the Kirk. However it did not end government interference with the church, particularly concerning the appointment of ministers. As a result there was a lot of controversy within the Kirk, starting with the Secession of 1747 over "a congregation's right to select its own ministers", and culminating in the Disruption of 1843 during which about a third of the congregation withdrew to form the Free Church of Scotland. The Free Church itself split into the Free Church of Scotland (known as the "Wee Frees") and the United Free Church of Scotland. Many other smaller subdivisions and denominations were formed during this period.
This situation lasted until the 1920s, when the British Parliament passed the Church of Scotland Act 1921. Parliament finally agreed that it had no sovereignty over the Kirk in matters of religious law and legislated to confirm the situation. This removed the main difference between the Kirk and the United Free Church and most of the United Free rejoined the Kirk. However both the Free Church and the United Free Church continue to the present day.
The Kirk has no compuslory prayer book although it does have a hymn book and an order of service, the Book of Common Order. However the latter contains recommendations rather than prescriptions. Women were allowed to become ministers and elders in 1968. In 2004 Alison Elliot became the first female and only the second lay Moderator of the General Assembly of the Church of Scotland. The first lay moderator, George Buchanan, acted four centuries ago.
While the Church of Scotland is an established (national) church, paradoxically it is also a free church. It is the only organisation in the UK over which Parliament has agreed that it is not completely sovereign. This means that Parliament cannot legally play any part in Kirk affairs without the Kirk's consent at its General Assembly. This does not happen as the General Assembly is very sensitive on the matter.
The Queen (when in Scotland) is a member of the Kirk with the same rights as any other member except that she, or her representative (the Lord High Commissioner), normally declares the General Assembly of the Kirk formally open. On her accession to the throne, she took an oath on 8 February 1952 to assure the security of the Church of Scotland. This contrasts with her position in the Church of England of which she is the "Supreme Governor". The English eventually settled on that term as both churches recognise the Supreme Head of the Church to be Jesus.