A sty, also called hordeolum, is a small abscess of the oil gland associated with an eyelash hair follicle. It typically contains Staphylococcus aureus bacteria, the cause of staph infections. When a sty develops, a small area of the upper or lower eyelid or the corner of the eye becomes red, tender and swollen. Swelling subsides gradually over a period of days after the sty develops an opening, and the pus is able to drain out.
A chalazion, like a sty, is a swelling within the eyelid caused by inflammation of an oil gland. A chalazion differs from a sty in that it does not contain an active bacterial infection. A chalazion is sometimes the aftereffect of a sty. It is less tender but lasts longer.
Natural oils from the eyelid's oil glands must drain through ducts out to the eyelashes. If debris blocks this normal drainage, it may cause a sty or chalazion. Sometimes, this debris accumulates because of a condition called blepharitis, a long-standing inflammation of the edges of the eyelids, with redness, thickening and scales and crusts.