Vitamin D is a spectrum of organic chemicals called calciferols, which vary in structure but all seem to have at least one important structural property: oxygen with a negatively charged lone pair of electrons.
The oxygen electrons are attracted to the mineral calcium, which is positively charged. Together, the two form a complex of the two which is more bio-available. This means that the mineral calcium, along with it’s “cofactor” vitamin D, work together as a unit to be better-assimilated into the body.
The complex can reach water in the body and tissues made of water (most of the body) but most importantly, the complex can also reach fatty/oily parts of the body (like crossing the cell membranes). This is because of the solubility of the complex. Whereas calcium is really only water-soluble, and the vitamin D is mostly fat/oil soluble, the complex can reach both.
So when you take mineral calcium, like the calcium carbonate in Tums, it helps to take it along with some (preferably natural) vitamin D to increase the absorption. If you don’t, then the calcium alone has trouble crossing fatty cell membranes (lipid bilayer structure) and the intestines, so it just passes through the digestive system without getting taken up by parts of the body that need it.
The benefit of natural calcium-containing foods is that they already contain the vitamin D, and so foods rich in calcium already have the complex. Think dairy (like raw, whole milk, which has everything a body needs). Just avoid pasteurized milk, which causes problems with assimilation.