In the iris, there are the 'Iris sphincter muscle' that constricts the pupil and the 'Iris dilator muscle' that enlarges the pupil.
Both muscles work in reverse, controlling the size of the pupil.
Ciliary body connected to the lens
The lens of the eye is connected to the 'ciliary body' through something like a string. When the ciliary body relaxes, the inner diameter increases. When the ciliary body relaxes, the lens becomes thinner and the refractive index decreases, allowing focus the light comming from far.
Conversely, when the 'ciliary body' is contracted, the elastic lens becomes thicker like a ball and the refractive index increases. Then you will be able to focus the light coming from near you.