Back in the day, retaking photos over and over until you got the perfect selfie just wasn't an option. First of all, you couldn't see what you just took as there was no LCD screen at the back to judge your composition and exposure. Also each and every photo you took ended up costing you money. You were limited to a maximum of 36 frames per roll of film and you would have to eventually develop the film into photos, which was another expense as well!
Similarly to how a modern-day digital camera's sensor works, film was used in its place by sitting at the back of the camera to gather light that passed through the camera's lens. The focussed light then passed through the lens's aperture, which controls the volume of light.
When the light finally landed onto the film, if exposed correctly by the camera's shutter speed and aperture setting, you would then have an image exposed onto the film. This is made possible due to the film containing silver halide crystals which are sensitive to light exposure.
Take a look at the video below by the YouTube channel, Smarter Every Day, on How Does Film Actually Work?