Evidence suggests that a longer version of the saying was circulating prior to the early- to mid-19th century. The meaning is thought to come from the way clams are protected during high tide, and although the connotations have changed slightly, this original concept is still is the heart of the expression today.
First Usage
This phrase is actually a part of the bigger phrase “happy as a clam in high water” or “at high tide.”
Source
And here I thought it was simply because their opening looked like an ear to ear grin… the more ya know! Thank you!
That’s probably part of it since I assume they would open to feed when high tide happens