A problem in many residential areas are loose dogs and cats. If, for example, the neighbor has animals that he lets roam free in his garden or on the street, these animals can of course also get into your garden.
Dogs in the garden
But that's a thorn in the side of some people, especially when the animals use the garden as a toilet. Here you have to make a difference. If the animal is a dog, you can forbid the neighbor to let it roam free.
Cats in the garden
It's different with cats. If the usual number of cats (two per household) go exploring and traverse your garden, maybe even doing their business there, then there is nothing you can do about it. Even if you know who owns the cats.
If there are more than two, then things look different again. Otherwise, courts rule that there are no limits to free-roaming cats. So you must approve the visit to the garden.