Yes, WebKit was based on KHTML and KJS. Even in the beginning, we made a few fundamental changes. Some of those were folded back in, but eventually those differences grew much, much larger.
There actually were some sites (in Europe, as I recall) that behaved a bit better when "KHTML" was in the user agent string.
I also included it as a nod to the original project. I wanted to show respect for the fine work of Lars Knoll and the other contributors.