How Scottish surnames began
Scottish surnames come from two great traditions. In the Highlands and islands, names grew from the Gaelic clan system: "Mac" (son of) joined to the name of a founding ancestor gave names like MacDonald, MacGregor and MacLeod, shared by clan members and followers. In the Lowlands, surnames developed much as in England, from places, trades and nicknames, along with Norman-French names brought by settlers in the 12th century.
Scottish names travelled widely with soldiers, traders and emigrants, and they are especially common today in Canada, Australia, New Zealand, Northern Ireland and the United States.
How the names work
Mac, Mc and M' are simply different ways of writing the same prefix and do not show whether a family is Scottish or Irish. People who lived on a clan's lands often took the chief's name even without a blood tie, so a clan surname shows belonging more than direct descent. Many clans have recognised tartans and "septs" — smaller family names that are linked to the larger clan.