Pod N of a StatefulSet is always named <set>-N. A headless Service named in the set's serviceName (Headless Services) gives each Pod a DNS record, <set>-N.<service>.<namespace>.svc.cluster.local, that follows it to a new node and IP. Replicas and etcd 137,357 members find each other by these names, and clients can address one member.
With the default podManagementPolicy: OrderedReady, Pod N is created only after Pods 0 to N-1 are Running and Ready, and scaling down removes the highest index first. A clustered database relies on this: the first member initializes the cluster and the others join. Parallel drops the ordering. Scaling StatefulSets shows both on BookNest's database.