knowyourphrase.com - The Meanings and Origins For Several Common Idioms and Phrases
Getting away freely from custody, punishment, or anything really.
This phrase is believed to have its origins somewhere in the 12th century, as that's when a scot was a tax a person would have to pay in England.
What's a scot, you ask? Well, according to Robert Hendrickson's The Facts On File Encylopedia of Word and Phrase Origins, a scot "was a municipal tax in 12th-century England." Hence, if someone were to avoid paying their taxes, they were getting away 'scot-free,' or in other words, tax-free. Eventually, it seems this phrase went on to describe, not just the avoidance of taxes, but people who slip away from any sort of punishment or precarious situation without harm.
Robert Green's "Pandosoto" or "Dotastus and Fawnia," first published 1588, contains the modern phrasing of the expression we know today:
"These and the like considerations something daunted Pandosto his courage, so that he was content
rather to put up a manifest injury with peace, than hunt after revenge, dishonour and loss; determining,
since Egistus had escaped scot-free, that Bellaria should pay for all at an unreasonable price."
Reference: The Phrase Finder
* Jason was being chased by a vicious pack of wolves, but he got away scot-free as he was able to jump in his car and quickly drive away.
Note: The origins for most idioms are unclear. Often times, the origins you see listed are plausible theories to how an idiom came to be, but may not necessarily so. Moreover, the quotes you see that contain the phrase are the oldest that I could find.
Keep in mind, just because you see a saying in a newspaper from 1850 does not necessarily mean that it originated from that newspaper. In all likelihood, if a saying is being used in a form of media like that, then it's probably already a known phrase and is thus, from an earlier time. The purpose of the old quotes I list is to give you a rough idea on how old some phrases are.