It's based on many factors that no one but qswitched have a clear mind on it. What i know is that it included solar abundance as a factor and it assumed that all material is harvested in zero gravity condition.
EDIT: As of hydrogen, qswitched mentioned that he raised the price as a result to simulate the differences storing it, like boil off due to heat from surrounding.
- Solar abundance. I suspect this may display artifacts if the Sun's expected composition is included, or other places we can't get to like planetary cores. Noteworthy that hydrogen deuteride can be obtained from gas giant atmospheres, in addition to plain protium. I think is is why deuterium isn't in short supply. There's also a reason helium-3 is cheap, a discussion which I think qswitched weighed in on once. However the rarity of every element doesn't seem to be adequately modelled, for example the rare metal hafnium is relatively expensive, but the even rarer metal osmium is about the same price as hyperabundant carbon.
- Melting and boiling points. Cost may be elevated if melting and boiling points are close together, and definitely is if the boiling point is very low (≲500K) or melting point very high (≳2000K). I think liquids may be exempt from this check.
- Tensile strength. Cost starts to rise above approximately 2GPa, though I think the threshold may depend on the type of material (alloy, fibre, organic compound, etc.).
- Phase. If a viscocity is present the material is assumed to be a liquid, otherwise it is solid. Liquids can be more expensive (metals) or much cheaper (organics) depending on the type of material.
- Molecular complexity. Pure elements are cheap (mostly 1–30c/kg). Any compound of more than two elements starts to become considerably more expensive (10–100c/kg). The number of elements also has an effect, as with UHMWPE (C200000H400000) being more expensive than LDPE (C2H4).
- Certain combinations are cheaper or more expensive than normal, eg. boron compounds are costly, while fluoropolymers and titanium intermetallics (aluminides) are cheap.
- Flags in the material's entry. These can be IsFibrous, IsPorous, IsANanomaterial, and IsABiomaterial. -- Fibrous and porous each multiply cost by around 10–1000% depending on the material. Porous will additionally restrict a material to only appearing as an option for armour. -- Nanomaterial has the same cost multiplying effect, but it can be much more extreme (see nickel phosporous microlattice's >4kc/kg cost due to being both porous and a nanomaterial). -- Biomaterial negates the added cost from both high molecular complexity and all the other flags, under the assumption that the manufacturing of the compound was performed automatically by a living organism. Spider silk is the only real example in the game, though one has to wonder where they're keeping enough spiders to armour 150m long spacecrafts.