"moan" denotes some kind of derived pleasure whereas "groan" does not.
The whispering moans of chocolate first entering the mouth.
The beams groan under the weight of the heavy roof.
When you like to know the difference in meaning between two words, it is best to do a google search by typing "X vs Y".