There are two ways to get into kernel mode: exception or an interrupt. In most processors, exceptions and interrupt have assigned numbers. The operating system must define a table that contains an array of pointers to handlers for each exception and interrupt.
If you divide by zero in your code, you are going to get into kernel mode as an exception. Then the processor jumps to the handler for divide by zero.
If you call a system service (on most systems) you execute an instruction that causes an exception to get you into kernel mode. The processor invokes the handler for the system service.
This is the general way things work. The Intel chips have bizarre ways to get into kernel mode.