Your eyelids have lots of tiny oil glands, which can become clogged. When a gland is blocked, bacteria can grow inside. This is what causes a stye to develop.