This means ‘flight,’ as in 1897, from a US slang verb meaning ‘to run off’ (1886), of uncertain origin. It might be from the first element of lambaste, which was used in British student slang for ‘beat’ since the 1590s. If so, it would give the word the same sense as the slang expression ‘beat it.’
‘Lam, lammister’ and ‘on the lam’ — all referring to hasty departure — used to be common in thieves’ slang. One word searcher actually traces it indirectly back to Shakespeare’s time. There are several colloquial phrases for leave-taking, such as ‘beat it’ and ‘hit the trail.’ The allusion in ‘lam’ is to ‘beat,’ and ‘beat it’ is Old English, meaning ‘to leave.’
‘On the lam’ or ‘on the run’ often refers to fugitives. The Thesaurus of American Slang proclaim that lam, lamister, and ‘on the lam’ — all referring to a hasty departure — were common in thieves’ slang before the turn of the twentieth century.
Another theory proposes that the term arose in 1682 when a group of Quakers were going to be arrested before they could flee to America so they left in the middle of the night and boarded their ship at a different port. The ship’s name was The Lamb, a part of William Penn’s flotilla.
‘On the lam’ is often associated with American gangsters during the depression and 1950s and another suggested source is the name Herman Lamm. Herman K. Lamm was a German-born bank robber who lived between 1890 and 1930. He is considered to be the father of modern-day bank-robbing.
And yet again, we learn that the root of ‘lam’ is the Old Norse word ‘lamja,’ meaning ‘to make lame,’ and the original meaning of ‘lam,’ when it first appeared in English back in the 16th century, was ‘to beat soundly.’ The English word ‘lame’ is from the same source, as is ‘lambaste.’
The Random House Historical Dictionary of American Slang defines the term as prison lingo for ‘an act of running or flight, esp. a dash to escape from custody.’ In his 1886 30 Years a Detective, Allan Pinkerton, the first ‘private eye,’ explains an operation of pickpockets: ‘After he secures the wallet, he will utter the word ‘lam!’ This means to let the man go and to get out of the way as soon as possible.’ The entry goes on to speculate that ‘lam’ may be rooted in the dialect Scandinavian verb lam, as in the 1525 ”his wife sore lamming him,” meaning ”to beat, pound or strike.”
Personally, I’d go with the Shakespeare explanation. After all, we blame him for almost every other expression we have!