X-rays can penetrate body tissues and many other things to varying degrees. During an X-ray procedure, electrons go through the patient and are absorbed to varying degrees by the animal. Those that make it all the way through hit a film and provide an image that is like a negative. The more electrons that go through the animal, the darker the image on the film. The fewer electrons pass through, the lighter the image on the film.
Air allows the most X-rays through the animal, resulting in a dark image.
Fat is the next opacity, creating a lighter image than air. Lighter still is fluid or soft tissue, then bone. The lightest opacity is metal. The X-ray film is developed much like photographic film in a processor. You can ask a human to hold still.