"Slug" comes from newspaper printing, where a slug was a short line of type identifying a story; from there it passed to publishing systems and finally to URLs.
In newspaper printing, a slug was a short line of type set above an article, identifying it for the editor and the typesetter. It was not the headline (which was the display copy) and not the story (which was the body); it was the internal label that let everyone in the newsroom refer to the story by one short name. From the print newsroom the word moved to editorial software, where it named the short identifier used in file names and internal references. From editorial software it moved to blogs and CMSs, where it named the short identifier used in URLs.
The slug is the URL-friendly version of the post title. It is usually all lowercase and contains only letters, numbers, and hyphens.
— WordPress Support, *Posts → Slugs*, 2024