The word comes from Heinlein's 'Stranger in a Strange Land' where it is a word used by a martian and that literally means "To drink".
The character in Heinlein's novel defines it as such:
'Grok' means to understand so thoroughly that the observer becomes a part of the observed - to merge, blend, intermarry, lose identity in group experience. It means almost everything that we mean by religion, philosophy, and science - and it means as little to us (because we are from Earth) as color means to a blind man.'