From TF2 Wiki
Defensive classes serve to inhibit enemy access and to hold enemies back from vital points on the map. In total, this group has the most firepower of all the groups, and these classes specialize in expelling this power at one time. Demomen can safeguard areas with sticky bombs and detonate them at will. Heavies are great for mowing down incoming troops and pushing back forces. Engineers can build sentry guns with amazing power, as well as teleporters and dispensers. Pyros can be used to hide in corners and ambush enemies trying to take the Intelligence or Control Point. They can also be used to safeguard Engineers' Buildings, by frequently spy checking. Their Flare Gun also allows them to check for spies at a distance.