  The formation of the chemical composition of neutron star envelopes, at high
densities is considered. As hot matter is compressed in the process of
collapse, which leads to the explosion of a core collapse supernova, the stage
of nuclear equilibrium with free neutrino escape, kinetic equilibrium in
\b{eta}-processes, and, as a result, the establishment of limited nuclear
equilibrium with a fixed number of nuclei takes place. Cold matter is
compressed at a fixed number of nuclei whose atomic weight initially does not
change and subsequently decreases. A pycnonuclear reaction of the fusion of
available nuclei and a decrease in their number begin at the end. The
compression of cold matter is accompanied by an increase in the mass fraction
of free neutrons. In this case, the chemical composition of the envelope
differs significantly from the equilibrium one and contains a considerable
store of nuclear energy. Nonequilibrium \b{eta}-reactions proceed at densities
exceeding the upper bound for the non-equilibrium layer density, which lead to
heating, nuclear energy release, and the possible attainment of a state of
complete thermodynamic equilibrium. The thermodynamics of nonequilibrium
\b{eta}-processes, which lead to the heating of matter as neutrinos escape
freely, is considered.
