I think any form of recognition in the form of a hug or thanks is nice. I have read some say that they were even incapable of selecting the "hug" option (only "thanks") because of the mode they log in through, so just clicked "thanks" to click something. But to more specifically answer, I tend to give hugs either when someone is struggling and they need a hug of support, or they write or do something that is sweet. The latter can also mean "thanks" in many cases, but it's a bit more personal and affectionate, in a sense. I do click "thanks" in mostly the same cases (clicking both), or when the thanks is less emotionally charged, such as if a member shared an interesting online article or fact/answer, or book suggestion. If you wrote "Soupe, it would be better if you put mayonnaise in it than catsup", I might only "thank" you rather than "hug".