Vitamin D is unusual among vitamins because the body manufactures most of it rather than obtaining it from food. That manufacture depends on sunlight angle, which makes geography a determining factor.
Synthesis begins in the skin
A cholesterol-derived compound in the skin absorbs ultraviolet B radiation and converts to a precursor, which then rearranges under body heat into the circulating form.
That precursor is subsequently modified in the liver and then the kidney into the active hormone, so what is measured in blood is an intermediate rather than the working molecule.
Only ultraviolet B drives the initial step. Ultraviolet A penetrates further and reaches the ground year-round, but it does not produce vitamin D.
Atmosphere filters by angle
Ultraviolet B is strongly absorbed by ozone, and the amount absorbed depends on how much atmosphere the light passes through before reaching the ground.
When the sun sits low, the path through the atmosphere is much longer, and the ultraviolet B fraction is filtered out almost entirely while visible light continues to arrive.
Above roughly the latitude of northern Europe or the northern United States, the sun stays too low through the winter months for meaningful production at any time of day.
Skin pigmentation changes the exposure needed
Melanin absorbs ultraviolet radiation, which protects against damage and simultaneously reduces the radiation reaching the compound that initiates synthesis.
More heavily pigmented skin therefore requires considerably longer exposure to produce the same quantity, an adaptation suited to high-ultraviolet environments.
Migration has separated pigmentation from the light environment it evolved in, which is why deficiency is more common among darker-skinned populations at high latitudes.
Modern living reduces exposure everywhere
Indoor work, glass that blocks ultraviolet B, covering clothing and sunscreen all reduce synthesis, and they operate even where the sun angle is adequate.
Sun protection remains important for skin cancer risk, so the two considerations pull against each other and are usually resolved in favour of protection plus dietary intake.
Food sources are limited, concentrated in oily fish and fortified products, which is why fortification programmes exist in many high-latitude countries.
Storage smooths part of the year
Vitamin D is fat-soluble and stored in adipose tissue, so summer production can support levels into the early winter before stores decline.
The depth of the winter trough depends on how much was accumulated, which is why levels measured at the end of winter differ from those measured in late summer.
Whether supplementation is appropriate, and at what level, depends on individual blood results and medical history, and is a decision for a doctor rather than a general rule.