What happens to your pupil in dim light and in bright light? Why does this happen?

I'll give brainliest :D