Cat head butting is something we have all seen and experienced. We know that it is a friendly greeting as it has all the appearances of that.
It's underlying purpose is as an extension of the scent exchange process that takes place between cats and between cats and humans (cats think that we are cats).
Head to head scent exchange between cats is carried our by rubbing the side of the head against each other. It is harder for a cat to do this with humans because the difference in size, but they manage by a little hop or a cat might even jump up a higher position and do it from there. The also rub the sides of the body against human legs.
Scent glands are located on the side of the face and flanks so it makes sense to rub with these areas of the body. There are no scent glands that I know of on the top of the head but this is still part of the overall scent exchange process. Once their scent is exchanged the cat feels more comfortable and the sharing of scents creates a communal family scent. Scents are a form of communication for the cat as spoken language is more of a form of communication for us (although smell is also useful for humans). Cat head butting is therefore akin to a pat on the shoulder and a friendly 'Hi, how are you' greeting or something more slangy.
A cat will check your scent by licking his body after rubbing against you to taste it. There is a well known picture of a cat head butting a horse's head on the Internet. I care for a stray cat and he loves to head butt, doing it a lot before settling in to eat. He is obviously pleased to see me (I wonder why :-).
Photo: copyright firepile reproduced under creative commons
From Cat Head Butting to Home page