Fundamentals of the theory of thermal conductivity