Traps are locations, which, when reached, call a specified macro. These traps can occur at a given location on the page, at a given location in the current diversion, at a blank line, after a certain number of input lines, or at the end of input.
Setting a trap is also called planting. It is also said that a trap is sprung if the associated macro is executed.