This paper presents studies on the carrier lensing effect of a tapered amplifier in a compact cavity-enhanced second harmonic generator. When different injecting currents are applied, carriers in the tapered amplifier are depleted to different levels depending on the local optical field intensity, resulting in a spatial variation of the refractive index and creating an effective convex lens for the amplified laser beam. This can significantly reduce the mode matching between the pump beam and the cavity, leading to a degradation of the second harmonic generator efficiency. To characterize this effect and provide guidance for mode matching, the evolution of optical fields and carriers in the tapered amplifier is simulated numerically with Maxwell-Bloch equations. The effective focal length of the tapered amplifier is calculated theoretically and verified with experimental calibration. Based on these results, the coupling optics of the cavity can be properly designed so as to achieve a high coupling efficiency. Finally, a single-frequency continuous-wave laser at 461 nm is achieved, with an output power exceeding 500 mW and a conversion efficiency of 33%.