In most communities, it is not illegal to trap stray animals. Cats that are allowed to roam at large, outside the control of their caregivers, are indeed considered stray.
American Humane Association strongly encourages caregivers to make sure their cats wear appropriate tags and collars, have an implanted ID microchip, and are kept indoors. Statistically, cats that live indoors have a much longer life expectancy -- often three to four times than that of outdoor cats. The threat of traps is only one of the perils that can befall outdoor cats. Cars, wildlife, theft, abuse, and exposure to contagious disease and parasites are also cause for concern. And, unfortunately, not all caregivers have had their cats spayed or neutered, which adds to the tragic pet overpopulation problem when their outdoor cats procreate.