The magnetic susceptibility of underdoped yttrium and lanthanum cuprates is interpreted based on the self-consistent solution of the t-J model of a Cu-O plane. The calculations reproduce correctly the frequency dependencies of the susceptibility in YBa2Cu3O7−y and La2−xSrxCuO4 attributing their dissimilarity to the difference in the damping of spin excitations. In YBa2Cu3O7−y these excitations are well defined at the antiferromagnetic wave vector Q = (π, π) even in the normal state which manifests itself in a pronounced maximum -the resonance peak -in the susceptibility. In La2−xSrxCuO4 the spin excitations are overdamped which leads to a broad low-frequency feature in the susceptibility. The low-frequency incommensurability in the magnetic response is attributed to a dip in the magnon damping at Q. The calculated concentration and temperature dependencies of the incommensurability parameter conform with experimental observations. Generally the incommensurate magnetic response is not accompanied with an inhomogeneity of the carrier density.