The influence of structural properties on the formation of perpendicular magnetic anisotropy in Co/Dy superlattices is investigated. It is established that superlattices are a compositionally modulated alloy in which, on the one hand, a strict periodicity is maintained in the thickness and composition of the layers, and on the other hand, the interdiffusion of Co and Dy at the interlayer boundaries leads to a periodic change with the depth of the concentration of Co and Dy. It is shown that the perpendicular magnetic anisotropy in Co/Dy is due to the perpendicular orientation of the magnetization in the alloying CoDy layers, while the magnetization of the Co layers is oriented in the sample plane.