The term used to be “happy as a clam in mud at high tide” and over the years, the phrase has been shortened. It still means, however, that the individual in question is very happy.
Clams are dug out of the mud when the tide goes out which means when it’s high tide, cannot possible be harvested. Obviously being left alone when it’s high tide is a much better situation than being harvested at low tide to be eaten later on.
The shortened phrase was used in 1840 by John G. Saxe in his poem “Sonnet to a Clam” but there is evidence it was used 10 years before publication of this poem. No one, however, seems able to find out when or where the longer phrase was first used.