A locked bootloader works with a trusted chain.
That means:
- There's a trusted enclave on your phone, usually inside the SoC but sometimes it's a dedicated chip. This chip has purposely very little access to it. This one contains the root keys for the encryption used on the phone.
- The phone only boots a bootloader verified by the trusted enclave.
- The verified bootloader verifies and only boots a verified system image.
If everything is implemented correctly and there are no bugs that can be exploited (like e.g. on newer Switch 1 models, older ones had a bug that was exploitable), then the only thing you can do is hardware exploits.
For that you could e.g. solder on a chip that hijacks the connection between the trusted enclave and the SoC (e.g. modchip on newer Switch 1 models) or you have to replace parts, e.g. the trusted enclave chip or the SoC (if the trusted enclave is within the SoC).
That's usually the point where it becomes too costly to be worth it.