How we synthesis vitiman D from the sun?
This guy does a nice brake down
https://www.youtube.com/watch?v=eVFICYDjReE The UVB radiation adds hydrogen to 7-Dehydrocholesterol molecule (cholesterol lacking hydrogen) the liver processes.
If you get the D3 from milk and eggs (usually not enough from foods) they don't need the sun.
One thing I found interesting in this is where does the bacteria (Bacteroides thetaiotamicron) come from to produce the 7-Dehydrocholesterol? our body can't produce it. It seems Thiamine (b1) helps process it.
https://pubmed.ncbi.nlm.nih.gov/28951891/