Kapt is basically just a bridge to the Java compiler’s APT. It creates Java stubs from Kotlin code, so that a Java annotation processor can run. Since APT is part of the Java compiler toolchain, a KAPT processor generates Java code.
KSP is the alternative for inspecting/generating Kotlin source code. But not all annotation processors work with KSP