Physical foundations of materials science