Defining custom `cfg` predicates

I'm a little confused how the kernel can be identified at compile time. Does this refer to the kernel headers being used to compile?