It works primarily through the jni-kit library, which handles JNI bindings between Swift and Java/Kotlin. You can check out the full docs here: https://docs.swifdroid.com/jni-kit/
On top of that, the IDE also auto-generates required Java/Kotlin classes on the fly, for example, for Activities.