This paper elucidates the compensation mechanism that ensures electrical neutrality following the substitution of Ca for the K-site. It utilizes density functional theory (DFT) to quantify the impact of defect clusters (specifically CaK-VK / CaK-VH) on potassium dihydrogen phosphate (KDP) crystals. Hybrid Functional HSE06 and FNV are employed for correcting band edge problems and defect formation energies, respectively. Cluster defects in PE-KDP and FE-KDP were computed using GULP. The calculated results indicate that CaK is compensated by VK in PE-KDP and CaK is compensated by VH in FE-KDP, respectively. The calculated defect formation energies demonstrate the readiness of forming 0 and -1 valence defects in both structures, while the +1 valence defect does not occur. Furthermore, the electronic structure analysis reveals significant lattice distortions in the presence of K vacancies within the PE-KDP structure. Upon conducting an analysis of the density of states, it has been determined that the reduction in the band gap can be attributed to the presence of Ca2+. Furthermore, its impact is primarily observed in the modification of the conduction band's lower boundary. Spectral analysis indicates that FE-KDP exhibits absorption and emission peaks within the UV range, suggesting its stability. In contrast, PE-KDP does not exhibit an absorption peak within the visible range but does emit additional light at 2.89 eV(429nm), when the electron jumps between the defect transition level and VBM. The calculated results implies that the presence of defects diminishes the efficiency of laser irradiation. This study provides valuable theoretical guidance for the practical implementation of KDP crystals.