Ok the bottom line is this. Camera lenses work similarly to the human eyes and our eyes' iris is like the aperture blades of the lens. U try to look at something close and u'll notice that the background is blurred so the same is for camera lenses. If u look at something which is close to the background then obviously everything will be in focus.
Our eyes automatically adjusts the opening of the iris according to how much light is avail so it optimises our vision in all light conditions; big when lower light and small in brighter light.