Animals have been going into cities mainly because of habitat loss. The more we destroy forests and different animal habitats the more animals might go into cities. For example, red foxes. You´d think that red foxes would live in forests and when their habitat is destroyed they would try to find a new forest, but they have been coming into cities and relying on trash for a food source. Also recently more animals have been coming into cities during shut down from the pandemic. They have seen less busy cities and decided to explore more.
To summarize it all, we have been building more cities, towns, and farms taking the wilderness away from animals. Shrinking their homes, forcing them to move into cities where they depend on our trash for food.
As cities and farms occupy more of the world's land, wilderness shrinks, forcing wild animals into cities for food. Our garbage cans and sewers are like all-you-can-eat restaurants to them.