A US-based story or Hollywood film about crime or criminals set in the first two-thirds of the 20th century is pretty likely to include somebody talking about “going on the lam.” What they mean is going on the run from the law; evading arrest. They might also say something like “beat it, the cops are on the way!” The two phrases “on the lam” and “beat it” are more closely related, origin-wise, than you might expect. In fact, one of them probably served as the basis for the other.
“Lam” arrived in English in the late 1500s from Old Norse, but back then it didn’t have anything to do with running away or escaping. Quite the opposite: “A Fellow, whom he lamb’d most horribly” meant that fellow had been thrashed; came out the loser in fisticuffs; got beaten up. This sense of the word, which is the same as its original meaning in Norse, persisted at least until the 1870s: “I wish I’d been there; I’d ha’ lammed him, I would!”
In 1932, the Baltimore Sun ran across a new use of “lam” and felt the need to explain it to their readers: “Lam, run away from the police.” It may not have been as new or unusual as the newspaper editors thought; Alan Pinkerton (the founder of the Pinkerton Detective Agency) had explained it half a century earlier: “After he [sc. a pickpocket] has secured 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.” Take this with a grain of salt, though; I’m not sure any pickpocket would announce his actions by saying anything.
The newer use of “lam” possibly comes from another slang expression: “beat it,” meaning “go away.” “Lam” meant beating, so “lam” might have become just a fancy-pants way to say “beat it.”
“Lam” also shows up in “lambaste.” It’s a compound word made up of “lam” and, obviously, “baste” — which, by coincidence, may have also come from Scandinavian languages, most of which have a word like “beysta,” meaning to beat or thrash. So really “lambaste” isn’t just compound, it’s also redundant. It originally meant to beat or thrash physically, but by the late 1800s it had shifted to refer only to a verbal assault: “His sermons got down to the bed-rock, even if they failed to lambaste wickedness with quite the fury it deserved.”
There’s another idiom that shows up in the same kinds of stories and films, and it doesn’t seem related at all: “cheese it, the cops!” That one is probably derived from “cease,” and it came from a different direction altogether; France (which is also good source of actual cheese). The strange coincidences in English never end.
(The title quote is from The Maltese Falcon.