Most oceanic trenches form in subduction zones. A subduction zone is where one tectonic plate slides under or subducts beneath an adjoining plate. The trench forms immediately above the subduction point.
Some trenches form as a mirror image of the process that creates mountains. The Rocky mountains formed when the western edge of the North American plate ran into the Pacific and Juan de Fuca plates. This slowed that side of the plate, but the eastern side continued to push on. This folded the crust upward forming the famous peaks that divided the continent. A mirror effect occurred off the East Coast. The slowing of North America but no slowing of Atlantic seafloor spreading, caused the seafloor to fold downward forming the Laurentian Abyssal. (This is just one explanation I've heard, there may be others).