Put simply... it was all due to a change in English marriage laws and a happy accident of geography!
In the middle of the eighteenth century, English law lords approved new laws to tighten marriage arrangements. Couples had to reach the age of 21 before they could marry without their parents' consent and their marriage had to take place in a church.
Scottish law however was different: you could marry on the spot, in a simple 'marriage by declaration', or 'handfasting' ceremony, only requiring two witnesses and assurances from the couple they they were both over the age of 16 and free to marry. With such a relaxed arrangement within reach of England, it soon led to the inevitable influx of countless thousands of young couples running away to marry over the border. Gretna Green was the first village in Scotland and conveniently situated on the main route from London into Scotland.
With Gretna Green perfectly placed to take advantage of the differences in the two countries' marriage laws and with an angry father-of-the-bride usually in hot pursuit, the runaway couple could not waste time. Therefore as soon as they reached Scottish soil in Gretna Green, they would find a place of security where they could marry at haste.