The Kube Controller Manager (KCM) is responsible for running controller processes that regulate the state of the Kubernetes cluster. One of its main functions is to maintain the desired state - including ensuring the correct number of pod replicas are running as specified in Deployments.
The KCM includes several controllers like the Deployment Controller, ReplicaSet Controller, and StatefulSet Controller, which continuously monitor the cluster state and work to maintain the desired configuration specified in your manifests.
The Kube Controller Manager (KCM) listens for changes on the Kubernetes API server through its various controllers. Each controller watches specific resources or endpoints through the API server.
For example, if you change the number of replicas in a Deployment from 3 to 5, the Deployment Controller (part of the KCM) receives this update from the API server and then works to ensure that 5 replicas are running by creating additional Pods through the ReplicaSet controller.