A chalazion is generally painless, slowly enlarging nodule on the eyelid formed by inflammation of the meibomian glands. It is basically a chronic granulomatous enlargement of the meibomian glands of the eye-lid.
The meibomian glands in the eyelid serve the purpose of lubricating the margins of the eyelids, by producing a layer of the tear.
Due to acute or subacute inflammation of the eyelid, which may be due to a stye, there occurs an obstruction of the duct of the meibomian gland, leading to retention of the tears and swelling of the lid.