How do shadows form?
Light from the sun travels in straight lines (apart from some wave effects called diffraction, that are unimportant in this case). As sunlight passes objects, those objects absorb or scatter the sunlight, leaving regions of space that no longer contain any electromagnetic waves. Regions of space behind the objects contain no sunlight and do not appear illuminated. We perceive those dark, unilluminated regions as shadows.