Your body depends on getting enough sunlight every day to function properly. Nature designed you that way. Our ancestors lived outdoors every moment of their lives. They hunted meat, fish and fowl. They ate, worked, gathered, celebrated, worshipped and mourned under the sun. So your cells, organs, bones and tissues evolved to rely on sunlight.
But just before the turn of the 20th century, our living conditions changed. It started with the invention of the light bulb, which gave us an artificial way to generate light. The industrial revolution soon followed, and people started migrating to the cities and working indoors.