An automatic transfer switch is the bridge between your utility company, your standby generator and the alternative source of energy. This is installed along with your whole home generator.
When the automatic transfer switch detects a lull or stop in the flow of power, an outage, it will turn the generator on and switch to the alternate source, i.e. natural gas. Once the utility power returns, the automatic transfer switch will shut off the alternative fuel, the generator and begin supplying your home with traditional grid-based power from your utility.