  The magnetic susceptibility measured in neutron scattering experiments in
underdoped YBa$_2$Cu$_3$O$_{7-y}$ is interpreted based on the self-consistent
solution of the t-J model of a Cu-O plane. The calculations reproduce correctly
the frequency and momentum dependencies of the susceptibility and its variation
with doping and temperature in the normal and superconducting states. This
allows us to interpret the maximum in the frequency dependence -- the resonance
peak -- as a manifestation of the excitation branch of localized Cu spins and
to relate the frequency of the maximum to the size of the spin gap. The
low-frequency shoulder well resolved in the susceptibility of superconducting
crystals is connected with a pronounced maximum in the damping of the spin
excitations. This maximum is caused by intense quasiparticle peaks in the hole
spectral function for momenta near the Fermi surface and by the nesting.
