What does "snug as a bug in a rug" mean — and why is it funny?

informal, humorous

Meaning

Very warm, cosy, and comfortable.

Where it comes from

An old English phrase, recorded in the 1700s. It survives mostly on the strength of its perfect little rhyme.

Why it is funny

The humor is the bouncy nonsense of the rhyme. Bug, rug and snug click together so neatly that the phrase feels like a tiny nursery rhyme, and you say it for the pleasure of the sound as much as the meaning.

Used in a sentence

"The children were tucked in, snug as a bug in a rug."