kernel_task is "killing" your entire system.
It's not the same as logging out; it's asking you to log out because everything will be going down.
From What Is kernel_task, and Why Is It Running on My Mac?
A “kernel,” if you didn’t know, is at the core of any operating
system, sitting between your CPU, memory, and other hardware and the
software that you run. When your turn on your Mac, the kernel is the
first thing that starts, and basically everything you do on your
computer flows through the kernel at some point. Activity Monitor puts
all of this varied activity under one banner: kernel_task.