Pupil constriction (miosis) is a normal process. The width of the pupil is controlled by interaction of sympathetic and parasympathetic nervous system that is independent on our will (sympathetic system causes dilation and parasympathetic narrowing). Under normal circumstances, the width of pupils changes with illumination level and with distance of observed objects.
Light and close object distance
Pupils tend to narrow in bright environment, while they dilate in the dark. The constriction of pupils also occurs when we try to focus our sight on close objects.
Medication and addictive substances
A number of substances affect the sympathetic and parasympathetic nervous system. If it causes predominance of parasympathetic system, the pupil will constrict and vice versa. This is common in opiates (addictive drugs used in the treatment of pain), various antipsychotic medications, heroin, organophosphates and some pesticides.
This syndrome is associated with unilateral constriction of the pupil, drooping of the eyelid and posterior displacement of the eyeball (enophtalmos). It is caused by local damage to the sympathetic system. There are more possible causes like lung cancer affecting the top of the lung (Pancoast tumor), a stroke or brain tumor damaging some parts of the brain stem.