Because light travels in straight lines, if its rays are blocked, a dark area of shadow is created.
When light strikes an object, some light reflects (based on the colour of the object). when there is an obstacle in the way of the light, and it cannot pass, there is no light to reflect, and thus a shadow is formed.
A SHADOW IS FORMED WHEN LIGHT SHINE AT AN OPAQUE OBJECT BLOCKING THE LIGHT RAY CAUSING A SHADOW BECAUSE LIGHT ONLY GOES IN A STRAIGHT LINES.