It depends on where you live. If you live in a city without predators, then letting your cat go outside in the backyard gives them a very exciting experience. If you live somewhere with coyotes, then your cat is going to die.
Outdoor cats have a shorter average life span in cities, too. One big cause is cars. Also, it’s worth noting that house cats are essentially an invasive species and do a lot of damage to bird populations.
It’s pretty widely recommended to keep cats indoors.
Dogs have to be put on a leash when their outside, outdoor city cats should be too. Stops them from running away, and killing birds.