Physics of electrons and phonons in low-temperature detectors