After some research, I finally got some details.
Unlocking a bootloader will generally not change the bootloader of a device.
The locked bootloader somehow ensures that the device should boot up with the OS that is shipped originally with the device or updated by the vendor officially.
Locked bootloader puts this as a security measure so that it can prevent the users
from installing custom ROM's. When the bootloader is unlocked it will simply provide the booting instructions to the device without checking for the stock ROM
on the device. The device will boot with the ROM present in /boot
and /system
partitions and thus unlocking a bootloader is an essential step if one want to install custom ROM.
Thus overall, locking a bootloader is just an extra built-in security check and
unlocking will just remove this check but will not modify the entire bootloader
of your device.