When you focus your camera, whether manually or with auto-focus, what you are doing is moving the glass elements in the lens and getting the light coming into the lens to converge on the sensor or film.
If the light coming into the lens converges, comes to a point, behind or in front of the camera’s sensor then the image will appear out of focus.
A similar example is if you use a magnifying glass to burn a hole in a leaf. In order for the light to be focused enough for the hole to be burnt, the light generally has to come to a point. In order to position the point of light on the leaf you either adjust the position of the magnifying glass, or you adjust the position of the leaf.
This is similar to what is happening inside your camera lens, the glass elements within the lens are being moved so that the light is brought together on the camera sensor. If you manually turn the focus ring, or use auto-focus, it’s the elements inside the lens that are moving in order to create an in-focus image.