A stye is an infection of an oil gland in the eyelid. It produces a red, swollen, painful lump on the edge or inside surface of the eyelid. They can appear very similar to Meibomian Cysts, however styes usually occur closer to the surface of the eyelid than do chalazia.
Styes are caused by an infected eyelash follicle.
Excellent information on styes is available from the American Academy of Opthalmology website here