The lens in a camera focuses the incoming light on the imaging sensor. The focus point depends on the distance from the object to the lens – the closer the object is, the farther away from the lens is the focus point. When a camera focuses on an object, it does so by moving the lens until the focus point coincides with the imaging sensor.
If an object is at “infinity”, the reflected light rays entering the lens are parallel, and they will always converge at the same point. The distance from the lens to that point is called the focal length, and it is measured in millimeters. Most lenses are described by their focal length, for example my camera has an 18-55mm zoom lens, which means it can vary its focal length from 18mm to 55mm.
The relationship between the focal length of the lens and the size of the imaging sensor determines the field of view of the camera. If the focal length is smaller, the field of view is wider and vice versa.
Consider a 35mm camera. It has a 36mm x 24mm sensor, which is a standard format (or was, back in the days, when a camera used film instead of digital sensors). The image formed on the sensor is therefore always 36mm wide. If the focal length of the lens is 24mm, then the horizontal field of view is 74°. If the focal length is tripled to 72mm, the horizontal field of view reduces to 28°. The effect is a higher magnification. A focal length of 50mm is called normal because it produces a field of view that is similar to human vision.
My camera has a 22.5mm x 15mm sensor and a 18-55mm zoom lens. This corresponds to a horizontal field of view ranging from 22° to 63°. For comparison the Moon has an angular diameter of about 0.5°. Obviously, I can not use my camera to take closeups of the craters on the Moon, but I should be able to take some decent wide angle photos of the stars.
FYI: I used this online calculator to compute the field of view.