A shadow is formed when an opaque object blocks light, creating a dark patch on a surface. The nature of a shadow depends on the object's distance from the light source, the light's direction, and whether the object is opaque, translucent, or transparent. Eclipses occur when celestial bodies pass through each other's shadows, with solar and lunar eclipses being the two main types.