The Kullback-Leibler (KL) divergence term in VAEs' loss function acts as a crucial regularizer, ensuring the learned latent distribution closely aligns with a predefined prior (typically Gaussian). This prevents overfitting and forces the latent space to be continuous and well-structured, directly contributing to more stable and reliable anomaly scores.