The processor (CPU) has a mode bit (bits). From privileged mode ring-0, the computer can run all instructions, and access all resources. The kernel runs in this mode. There are instructions to change mode, e.g. change to usermode ring-3 (ring-1 and ring-2 are not used).
The instruction to move to privileged mode, are more complex. These are interrupts and traps: If hardware interrupts, or a user mode program executes a software interrupt, then the processor looks up a pre-registered address, changes mode puts return address on stack and jumps to this address. Only privileged mode can can register these addresses (it is analogous to set-uid).
As for memory: in both modes, user and kernel memory is mapped. However in user mode kernel memory is disabled. When a jump is made to kernel space it can be quickly re-enabled.
This is not specific to a particular CPU, except the mention of rings (used on x86). If you wish to learn how the CPU does things, then the ARM is one of the simplest, contemporary processors. x86 is more of the most complex (but not in a good way).