What is the primary function of an Automatic Transfer Switch (ATS) in data center power infrastructure?