I know very little about nutrition but have wondered whether taking supplements actually help, or if it's the process that _creates_ those vitamins that's actually important/healthy.
Like in your example, being exposed to sunlight starts a process in our body that's healthy for our bodies, and vitamin D is just a by-product... and taking it as supplements wouldn't really do anything as we're missing the process.
Vitamin D is arguably not a vitamin because we produce it when exposed to sunlight and it's actually a hormone. I guess that makes sunlight the vitamin.
It could easily be some of both, in which case a supplement is not necessarily worthless, but not as good as sunlight (and the exercise and stress reduction that often goes with it).
Like in your example, being exposed to sunlight starts a process in our body that's healthy for our bodies, and vitamin D is just a by-product... and taking it as supplements wouldn't really do anything as we're missing the process.
As I said I have no idea what I'm talking about.