The kernal is contained by and is the core of the ROM. The ROM accesses hardware services via the kernal.
The kernal wraps (abstracts) the hardware so that all the other aspects of the ROM can make simplified calls to the kernal when they want to access the hardware in some way.
So the kernal is an interface to the hardware. It's value is in wrapping the hardware into a nice set of API calls for the ROM that abstract away the messy details of interacting with the hardware.
Otherwise every part of the ROM would have to know the ins and outs of the hardware. This leads to bloated, fragile components.
So yes you can alter the kernal independently of the ROM. But you must ensure that when replacing your kernal your ROM can still understand how to make calls into it. i.e. Not all kernals are compatible with all ROMs. When you do a ROM update however you are typically replacing both the ROM and the kernal. i.e. the kernal is bundled with in your ROM update.
But when you do something like rooting. You are replacing your "bundled" kernal with one that allow you superuser access to core of the OS/ROM. So in this instance the outer shell (i.e. the ROM) is being left as is and you are just replacing the inner core. i.e. kernal.