Scotland and England had separate Monarchs and were separate countries until 1603, when Queen Elizabeth died without any heirs.
The next in line of succession to the English throne was James VI, the King of Scotland who became known as James I in England.
Scotland and England, together with Wales united in 1707 to form the Kingdom of Great Britain by the Act of Union passed by the Scottish Parliament and the English Westminster Parliament.
The Irish Parliament voted to join the Union in 1801 when the then Kingdom of Great Britain became the United Kingdom of Great Britain and Ireland. The full name of the UK then changed in 1922 when most of the Southern counties in Ireland became independent and ultimately became what is now the Republic of Ireland, leaving the UK as the United Kingdom of Great Britain and Northern Ireland.
Great Britain comprises only England,Scotland and Wales which is why the full name of what is referred to as the UK is the United Kingdom of Great Britain and Northern Ireland, quite a mouthfull. I personally only write the term United Kingdom for postal purposes but as has been previously stated for genealogical purposes it suffices to use the country names of England, Scotland, Wales and Ireland orNorthern Ireland.