@Hailong
KMP goal is to provide a good multiplatform option that allows to access native APIs while sharing code in a convenient way. There's probably other goals, but I'm leaving it to your imagination.
For your second question, I'm not sure what you call "the principle of KMP compiler". BTW, there's no multiplatform compiler. Only a Gradle plugin or compiler arguments that can build the same Kotlin code for multiple target platforms with a different compiler (though some can share some code).