ReplicaSet uses the labels defined in the selector property to find all the pods with the specified labels. Once it finds them, it makes sure that the number of existing pods matches the number of pods requested via
If the number of pods is less than specified, it uses the provided template to create a new pod. If this pod has the labels that match the ones specified in selector, it will take this new pod into consideration when counting again.
ReplicaSet doesn't just manage pods that it creates, it manages all pods with a given label, no matter the source.
The actual process performing this work is K8S Replication Controller.
ReplicaSet can be a target of K8S Horizontal Pod Autoscalers.