The Kirk was founded during the Reformation by John Knox. He based its doctrines and government on the Presbyterian principles of John Calvin which he had been exposed to while living in Switzerland. In 1560, the Scottish Parliament adopted Presbyterianism as the state religion and set up the Kirk structure to implement it. However while Parliament was supportive of presbyterianism, the King was not. Over the next hundred 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 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. 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 congregations rejoined the Kirk. However both the Free Church and the United Free Church continue to the present day.
The Kirk has no 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.
While the Church of Scotland is a state church, paradoxically it is also a free church. It is the only organisation in Britain 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 is a member of the Kirk with the same rights as any other member except that she, or her representative normally declare the General Assembly of the Kirk formally open. This contrasts with her position in the Church of England, the other state church of the UK, of which she is the "Supreme Governor". The spiritual leader of the Church of Scotland is Jesus Christ.