A locked bootloader prevents new or manipulated operating systems from being installed on your device.
More information
Normally you have to unlock the bootloader manually. This is often necessary if you want to install new operating systems on your device, for example. On many Android devices, this leads to the factory settings being restored and to data loss. Some manufacturers require you to request special codes for this. So you usually know whether the bootloader of your device has been unlocked or not. You should definitely lock the bootloader again after installing your own system.
If you have activated the developer options in the settings, you can usually check under OEM unlocking to see whether the bootloader is probably unlocked or not. If you see a warning message such as "The bootloader is unlocked and the software integrity cannot be guaranteed." when you start your device, your bootloader is definitely unlocked.