Vitamin D is synthesized in the skin upon exposure to sunlight or obtained from dietary sources. It is then metabolized in the liver and kidneys into its active form, calcitriol (1,25-dihydroxyvitamin D), which acts as a steroid hormone to regulate calcium and phosphate metabolism, affecting bone health, kidney function, and immune responses.