The generator is connected to the building’s electrical system via an automatic transfer switch (ATS), which automatically switches between utility power during normal operation and generator power during a power loss. The engine starts automatically with the help of an alternator when the generator detects a power outage.