A truss provides the structural support of the roof where the sheathing or decking is nailed to. It provides the same function as a rafter for a roof; however instead of being a single board running up to the ridgeline a truss is prefabricated in a triangular shape with support boards. It effectively transfers the load of the roof to the exterior walls, leaving the interior walls non-weight bearing.
Trusses have several advantages over stick built rafters. For one a rafter is cut at the job site, while trusses are generally ordered and constructed by a truss manufacturer then shipped to the job site. This speeds up this portion of the building process. Trusses can also span larger distances than rafters, and can be built to allow for more elaborate cathedral style ceilings. And because they are built using smaller lumber, trusses are often a cheaper route. They also allow for a lot of customization and flexibility for home floor plans with less need for load bearing interior walls.