  In this paper, we analyse the metallicity structure of the Magellanic Clouds
using parameters derived from the Gaia DR3 low-resolution XP spectra,
astrometry and photometry. We find that the qualitative behavior of the radial
metallicity gradients in the LMC and SMC are quite similar, with both of them
having a metallicity plateau at intermediate radii and a second at larger
radii. The LMC has a first metallicity plateau at [Fe/H]$\approx$-0.8 for
3$-$7$^{\circ}$, while the SMC has one at [Fe/H]$\approx$-1.1 at
3$-$5$^{\circ}$. The outer LMC periphery has a fairly constant metallicity of
[Fe/H]$\approx$-1.0 (10$-$18$^{\circ}$), while the outer SMC periphery has a
value of [Fe/H]$\approx$-1.3 (6$-$10$^{\circ}$). The sharp drop in metallicity
in the LMC at $\sim$8$^{\circ}$ and the marked difference in age distributions
in these two regions suggests that there were two important evolutionary phases
in the LMC. In addition, we find that the Magellanic periphery substructures,
likely Magellanic debris, are mostly dominated by LMC material stripped off in
old interactions with the SMC. This presents a new picture in contrast with the
popular belief that the debris around the Clouds had been mostly stripped off
from the SMC due to having a lower mass. We perform a detailed analysis for
each known substructure and identify its potential origin based on
metallicities and motions with respect to each galaxy.
