A transfer switch is a switch that moves electrical load between two different sources, normally between a generator and an electrical panel/utility line.
Transfer switches can be automatic (ATS) (common with standby generators) or manual which require you to physically move the switch when you want to redirect the source of electricity. Both types ensure that power is not backfed to the generator or utility line when changing back and forth.
There are many options available and correct selection will depend on your specific home's needs.