The SPD (Serial Presence Detect) is a chip found on each RAM module.
It allows your motherboard to know that the RAM is present, as well
as tell it what settings to use in order to access the RAM.
When you power on your computer, it executes a boot check, also called POST
(power-on self-test). That’s a series of basic tests for the hardware,
performed under the instructions of the UEFI/BIOS.
As described in your Wikipedia article, the UEFI/BIOS communicates
through specified addresses using the computer's SMBus,
and the SPD chip answers according to a known protocol.
The answer is then : The XMP profiles are stored on the SPD chip,
as installed and burnt into this chip by the RAM manufacturer.
XMP-nnnnabove the timing data if it was read from the XMP data, rather thanJEDEC #n. Can't be 100% sure though because none of this is documented... – Sam Morris Jan 13 '23 at 09:47