The story
From cheek + by + jowl (“cheek; jaw”) (or possibly jowl (“fold of fatty flesh under the chin, around the cheeks, or lower jaw; cheek”) or jowl (“(obsolete) head”)), suggesting people so close to each other that the cheek of one person is next to the jowl of another.
Etymology from Wiktionary, CC BY-SA 4.0.