When James VI of Scotland became James I of England as well, he moved to London. While there he learned about the Anglican church and decided he liked it, it being less democratic than the Kirk. The Kirk, or the Church of Scotland, has all of its officials elected by the people - this is known as Presbyterianism - and they did not always agree with the King.
James' son Charles I much preferred the English system of appointed bishops so he told the Scots to change the structure of their religion, which they didn't like. This included the use of a new, English-style, service book. When this book was introduced in Edinburgh a riot ensued. Thus, on 28 February, 1638, the National Covenant was signed in Greyfriars Churchyard in Edinburgh by the leading Scottish nobles. It was then distributed around the country to be signed by the peasantry. This document was a petition, claiming support for both the King and Presbyterianism.
The signing of this document, and the King's refusal to agree to its demands, eventually led to a civil war, known as the Bishops' War. Charles I was defeated in this. There was no actual fighting during the two Bishops Wars. On both occasions, the two sides raised an army (Charles had difficulty with this, due to his unpopularity with the English parliament) and marched to meet each other. When they met, the King and the High Heid Yins of the Covenanters would talk, and eventually Charles would agree to abide by whatever the people, in the guise of the Scottish Parliament and the General Assembly of the Kirk, decided. He never did abide by these decisions, but no actual battles were fought during these 'wars'.
A couple of years later, when Charles I went to war against his English parliament (at this time Scotland still had a fully independent parliament of its own), the parliamentarians asked the Scots Covenanters for help. A deal was signed, whereby the English would become Presbyterian in return for the Scots help. This lead to the defeat of Charles I at Marston Moor and his eventual total defeat.
When the English Parliament then executed the King, the Scots complained that a) that wasn't part of the plan, and b) why hadn't England become Presbyterian. Thus the Scots crowned Charles II King, and Cromwell invaded and eventually won. This makes him the only man to have successfully invaded Scotland.
After the restoration of Charles II in 1660 he attempted to introduce the Anglican faith once again, causing a second wave of Covenanters. This wave was not as universal, however. There were no big armies. Rather, Covenanters would convene for outdoor services while Government soldiers hunted them across the moors. This was worst during the period 1678-1685, a period known as the 'Killing Times' - and you can still see many memorials today to those who died for their faith.