The earliest burghs in Scotland were created in the 12th century under King David I. The chosen towns enjoyed special privileges which were awarded by means of charter. Privileges included being allowed to make (and enforce) localised laws, to allow local merchants to set up trading consortiums and hold local markets, the town could elect it's own town council and decide to fortify their town the way they saw fit - usually by encircling the town with a wall, burghs could even raise their own money through tolls. Most of these new burghs were close to Royal Castles or important abbeys. David I may have seen it as a way of enforcing his rule over some of the more lawless parts of his kingdom.
At the centre of many burghs in south west Scotland would have been the mercat cross which would have been surrounded by the homes of the burgesses and merchants who benefited most from the towns new privileges.
The 16th and 17th centuries saw the establishment of 'Burghs of Barony' and many towns in south west Scotland received Charters - Newmilns in 1491, Auchinleck in 1507, Cumnock in 1509,Riccarton in 1638. Many towns prospered after being granted their Charters, trading in agriculture, livestock and textiles. By the 18th century coal and textile production dominated industrial expansion. Many towns and burghs became famous for specialised industries; Stewarton was famous for its bonnets and the Irvine Valley was renowned for it's lace industry.