How does apply(plugin = "java") work when using Kotlin for build scripts?

Hey guys, I am quite confused about how does the following expression works when writing scripts with Kotlin:

apply(plugin = "java")

I found Project has apply(Map). But it seems Kotlin does not support converting named arguments to a map. Does Gradle do the magic?

I have found there is an extension function apply().