The Parliment of England passed the Act of Union with Scotland in 1706, and the Parliment of Scotland passed the same act with England one year later. The two Kingdoms had been separate for a long time, but they had been joined in 1603.
James VI of Scotland was the closest heir to Elizabeth I of England, therefore, the Kingdoms joined. However when under one monarch, the two parliaments were still separate.There were three tries to join each other, but every time, one side or the other disagreed.
When Queen Anne became Queen in 1702, her main goal was to organize a treaty for a union, and in 1706, both sides had good reasons to join forces. Scotland had always wanted to remain independent, because of their free-spirited freedom-loving nature. England had tried to take Scotland by force many times, but each time without permanent success.
Scotland wanted to join England because of the colonial markets after Caledonia turned out to be a miserable failure. While England wanted to join Scotland to make sure the Rulers would be the same to prevent future wars of Religion on the land. They both officially joined in 1797, and were combined into a new nation, Great Britain. There were 25 articles, and 15 of them were related to economics.
After all that time, the Parliaments were merged into one.