Traps (of any type) have no role in oil and gas formation. They only host the hydrocarbons after they migrated from a source rock. The source rocks (e.g., organic/bituminous shales etc.) are reponsible for hydrocarbons generation.
In certain geologic provinces (e.g. rift basins) you may find that source rocks are deposited in lakes that are later filled with sediments. As regional tension occurs, the fault blocks will pull apart and tilt, resulting in a structural trap of the later sediments. Hopefully that gets covered by seal rock to secure the trap. Once the trap is in place, as the previously deposited source rocks are buried deeper, they heat up and generate hydrocarbons that then migrate into the trap. Fluid densities of hydrocarbons make them want to go up under most circumstances, relative to the naturally water wet rocks surrounding the source rock. Carrier beds/faults will allow the hydrocarbons to flow until they reach either the surface or a trap with a sufficient seal to hold them back.
Structural Traps come in many flavors, and nearly all traps characterized as stratigraphic traps have a structural element.
Structural Traps can be "4-way" features, a structural culmination for which closing contours form a closed trap
As indicated by other answers structural traps can be "3-Ways" Closing contours are in part bounded by a fault. In the case of rift basins and commonly in Deepwater and Deltaic systems these traps are down-thrown to a regional high. So the trap occurs in the footwall with closing contours terminating updip to a master fault.
Fault Seal traps which as also structural will have closing contours terminating against a sealing fault. This fault may occur anywhere along the trap, in dip or strike direction.
As noted stratigraphic traps will have a structural component. Usage of the term Stratigraphic Traps is not always consistent. In Deepwater, many Channels are trapped by a combination of structure in the dip direction, and stratigraphy in the strike direction. The channel margin forms the stratigraphic element of the trap, typically in the strike direction.
Updip pinch-out stratigraphic traps have closing contours which begin downdip then terminate updip to the reservoir termination or pinchout.
I think other answers cover the rest of structural trap concepts.
Very good point made by Jamie, Structural Traps only require a Top Seal for Four Way Closures. Additional seals only are required in complex traps, 3-Ways, or simple fault seal. In the more complex cases sealing against a fault adds another dimension.
In contrast, Stratigraphic Traps require both a Top Seal and a Base Seal.
In petroleum geology, a structural trap is a type of geological trap that forms as a result of changes in the structure of the subsurface, due to tectonic, diapiric, gravitational and compactional processes. These changes block the upward migration of hydrocarbons and can lead to the formation of a petroleum reservoir.
Structural traps are the most important type of trap as they represent the majority of the world's discovered petroleum resources. The three basic forms of structural traps are the anticline trap, the fault trap and the salt dome trap.