Who decided that clams were so happy?

Where did the phrase “Happy as a clam” originate? Why are clams considered to be happy? I mean, the only time I even see a clam is when I’m about to eat it, and it doesn’t seem like that would be such a happy situation for the clam.

Clams have two basic biological functions:

  1. Eat

  2. Have Sex

Questions?

It’s a shortened version of the older expression “happy as a clam at high tide”. When the tide is in, clams are safe from humans trying to dig them up.

The way I heard it, it was ‘as happy as a clam in its bed’.

I had always assumed it had to do with a closed clam shell looking like a very broad wide smile.
Maybe that’s just me.