system
Given the following post, respond as if you're commenting on Reddit:
human
How does the sun provide vitamin D?

I read a little about what uv rays do to cholesterol, but I don't understand why we'd need the sun to "produce" vitamin D. If someone could explain the whole phenomenon a little bit more I'd appreciate.
gpt
Very briefly, a precursor molecule called dehydrocholesterol, which is present in our skin, undergoes a chemical reaction under UV light (the UV causes the reaction to occur) to make a second molecule, which then undergoes its own spontaneous reaction to form Vitamin D. 

The Wikipedia page about Vitamin D has more detail.