How it works…

Extension functions are resolved statically, which means they are normal static methods and have no connection to the class they are extending (that's why we are able to extend classes to which we don't have access to modify), other than taking an instance of this class as a parameter.

If you decompile the Kotlin bytecode, you will see the code converted to Java:

private static final boolean isAgeGreaterThan20(@NotNull Student $receiver) {
return $receiver.getAge() > 20;
}

As you can see, it is just a static method and takes the class as a parameter.