QM, what it essentially means is 'I found that funny' - so in written communication it's the equivalent of laughing in real life, of appreciating a joke.
But people also seem to use it of their own statemetns to imply something like 'tongue in cheek' or 'don't take this too seriously'. I think that's very valuable. It can be difficult to explain in print, especially electronically, that you're joking, especially given the British taste for 'irony', meaning you say something outrageous in the expectation that people will realise you don't - can't - possibly mean it. Other readers, perhaps not British, do indeed misunderstand and take it seriously, and so blood feuds are born. So lol can be a very useful signifier, the way a laugh or a smile would be in a face-to-face conversation.