Stable laser emission with narrow linewidth is of critical importance in many applications, including coherent communications, LIDAR, and remote sensing. In this work, the physics underlying spectral narrowing of self-injection-locked on-chip lasers to Hz-level lasing linewidth is investigated using a composite-cavity structure. Heterogeneously-integrated III-V/SiN lasers operating with quantum-dot and quantum-well active regions were analyzed with a focus on the effects of carrier quantum confinement. The intrinsic differences were associated with gain saturation and carrier-induced refractive index, which were directly connected with 0- and 2-dimensional carrier densities of states. Results from parametric studies were presented for tradeoffs involved with tailoring linewidth, output power, and injection current with different device configurations. A multi-objective optimization analysis was provided to optimize the operation and design parameters, serving as an analytical tool for parametric studies to produce timely results in engineering design.