Sunlight exposure triggers vitamin D synthesis in skin cells - ultraviolet B rays convert 7-dehydrocholesterol (a skin oil compound) into previtamin D3, which becomes vitamin D3. This is essential for calcium absorption, bone health, and immune function. Infrared rays don't kill bacteria internally, and tanning is a side effect, not the health benefit.