This is a territorial name found in Ayrshire. It is likely that it derives from 'cuinneag', meaning 'milk pail' and the Saxon 'ham', meaning 'village'. The first to take the name was Warnebald or perhaps his son, Robertus, who received a grant of land of Cunningham, somewhere between 1160 and 1180. A story also states that Malcolm, son of Friskin, obtained the lands of Cunningham from Malcolm III by sheltering him in a barn and covering him with hay. This is said to give rise to the shake-fork in the family arms and the motto, 'Over fork over'. This is a charming legend, but Sir George Mackenzie states that the arms are an allusion to the office of Master of the King's Stables. Another explanation runs that the Cunninghams were great allies of the Comyns, whose shield bore sheaves of corn. When that great dynasty was overthrown by the Bruces, the Cunninghams adopted the shake-fork used to 'fork over' sheaves of corn, as an ingenious reference to their former allies. It is certain that the Cunninghams were well settled in their lands and the parish of Kilmaurs by the end of the thirteenth century. Hervey de Cunningham, son of the Laird of Kilmaurs, fought for Alexander III against the Norwegian invaders at the Battle of Largs in 1263. He received from his king in the following year a charter of confirmation to all of his lands. The Family were supporters of the Bruces in their fight for Scottish independence, although in common with a great many of the Scottish nobility, their name appears on the Ragman Roll, swearing fealty to Edward I of England in 1296. Bruce was generous towards his supporters after his great victory, and the lands of Lamburgton were added to Kilmaurs by royal chater in 1319. Sir William Cunningham of Kilmaurs was one of the Scottish noblemen offered to David II's English captors as substitute hostages in 1354. His son, also William, married Margaret, the elder daughter and co-heiress of Sir Robert Denniston of that Ilk, and through her acquired substantial lands, including Finlayston in Renfrewshire and Glen Cairn. Sir William's grandson was created Lord Kilmaurs in 1462 and later Earl of Glencairn. A younger brother was ancestor to the Cunninghams of Caprington who were later to achieve prominence of their own. Other distinguished branches of the family include the Cunninghams of Cunninghamhead, Aiket, Robertland and Corsehill. However, the fortunes of the family remained firmly in the hands of the main line, the Earls of Glencairn.

The fifth earl was a Protestant reformer and a patron of the reformer, John Knox. He has been accused of being in the pay of the English, who saw the Reformation as an opportunity to discomfort the Scottish Crown. Whatever the case, Glencairn rose against Mary, Queen of Scots, and was one of the commanders at the Battle of Carbery Hill where she surrendered in 1567. Glencairn is said to have ordered the destruction of the Chapel Royal at Holyrood. The Cunninghams also were among the Scottish undertakers of the Plantation of Ulster, and Sir James Cunningham, who was married to a daughter of the Earl of Glencairn, was granted five thousand acres in County Donegal. The name is now among the seventy-five most common names in Ulster. The ninth earl threw in his lot with Charles II in his bid to gain his father's throne. He raised a force in 1653 to oppose General Monck, who was governor of Scotland. In August he went to Lochearn in Perthshire where he met with some chiefs of the Highland clans, and with a body of fighting men, took possession of Elgin in 1654. He announced his commission on behalf of the king to raise all of Scotland against the Protector, Oliver Cromwell. The rising was a failure, but Glencairn escaped with his life and after the Restoration he was appointed Lord Chancellor of Scotland. The title is now extinct. Sir John Cunningham of Caprinton, a distinguished lawyer, was created a Baronet of Nova Scotia by Charles II in 1669. Other prominent Cunninghams include Alexander Cunningham, eighteenth-century historical writer, who was British envoy to Venice from 1715 to 1720. Charles Cunningham was famous for his historical paintings, some of which still hang in the Hermitage Palace in St. Petersburg and in Berlin. Sir William Cunningham of Robertland was a friend of the poet Robert Burns. Alan Cunningham, poet and writer, whom many believe was only eclipsed by Burns himself, was born at Blackwood in Dumfriesshire in 1784. His work was supported by Sir Walter Scott who, on Cunningham's death in 1828, provider for his two sons.