if project treble aims to separate the platform and vendor partitions, why is the kernel source code needed when building system.img (platform)

if project treble aims to separate the platform and vendor partitions so they can be updated separately, why is the kernel source code needed when building system.img (platform) for AOSP, isn’t the kernel source code provided by the vendor side?

p.s is the kernel source code used to build the core system/framework files or is it only used in the boot.img/recovery.img?