Even if there is only one cat living in the house, and it may not even leave the house, it can still start marking its territory.
At first glance, it may seem that the animal is taking revenge on its owner in this way.
If there is no reason for resentment, then this may indicate that in this way the animal warns that the house is hers.
This can happen if someone comes to visit with another pet, as well as in situations where the owner petted another animal and the smell from it remained on the clothes.
In addition, a pet can simply smell or see a strange cat through an open window, which will also cause stress.
In such cases, the cat may think that the stranger should be warned that everything is occupied.
To get rid of the problem, you need to devote more time to the animal, ensure its maximum safety, and it would not be a bad idea to castrate it.