The kernel usually just needs to know which binary to execute as init, which is often provided as kernel command line argument by the bootloader.
In the Gentoo kernel make menuconfig there are options for Systemd vs OpenRC - not entirely sure what they do.