Where does grub-mkconfig get the UUID for root?

When I run grub-mkconfig on Debian 10, it generates smth like:

...
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  fc6c3fbf-8cfc-411c-ac5d-072c6e8c8092
        else
          search --no-floppy --fs-uuid --set=root fc6c3fbf-8cfc-411c-ac5d-072c6e8c8092
        fi
        linux /boot/vmlinuz-4.19.0-9-amd64 root=UUID=e0674dbf-3546-4898-9933-c9eb55703cb5 ro single
        initrd /boot/initrd.img-4.19.0-9-amd64
...

What is being done in this piece of the program and why it uses different UUIDs? And where these UUIDS was taken from?

Go to Source
Author: Alex Noname