Basically taking the mick or being sarcastic 'humourously' about someone! Well that's what I think
I do it all the time with a couple of friends of mine but they give as good as they get!!!
In "taking the..." format, the phrase has existed only since the 1940s. However, prior to that, one of the meanings of the actual word itself was 'spirit' in the sense of 'go' or 'oomph'. So, perhaps, "taking it" - as in making fun of someone - meant 'taking the stuffing out of...", as it were.
Sorry for stealing Quizmonster's sources ;) but you'll find a full explanation here http://www.worldwidewords.org/qa/qa-tak2.htm
"Taking the mick" developed as a short version of "taking the micturation" which along with "taking the urination" was a jocular form of the expression used in more polite society.
Dear Omblod, I believe I may have introduced Michael Quinion's wonderful "Worldwidewords" website to the wider AB community...certainly I'd never seen it referred to here before I did...but I surely wouldn't claim it as my source. Not now, anyway, given that just about everybody and his granny have cottoned on to it! Cheers