Dilation and constriction of the pupil are a natural reaction to light or darkness.
However, pathological mydriasis (dilation of the pupil) and miosis (narrowing of the pupil) are already symptoms and it is necessary to diagnose the cause.
One of the common risk factors is head trauma - with this type of pathology, nerve damage is quite likely, which negatively affects the pupil.
As for the reduced reaction to light, in this case the cause may be a side effect of some medications.
Such serious disorders of the nervous system as stroke or epilepsy often become the cause of pathological dilation of the pupil.
You have probably noticed that the pupil of older people is narrowed in size - this is due to the age factor. You will see the same result in newborns - in the first weeks after birth, the infant's pupil is small (a small pupil protects the developing eyes).
Be sure to consult an ophthalmologist if you notice that your pupil remains dilated despite bright light or continues to contract/narrow in the dark. You should also consult a doctor if these symptoms are accompanied by a headache or blurred vision.
Source:
https://www.bookaneyetest.co.uk/post/pupils-eyes-not-responding-light