Unlike dogs, cats are not considered social animals. This means that even feral cats who live in a colony are independent and territorial. Their loner nature makes it necessary for cats to communicate with each other even when they do not meet face to face. Scent -- specifically spraying -- is one way they do so.
What Spraying Is
Spraying is when a cat backs up to a vertical surface, such as a doorway, wall or piece of furniture, and directs a stream of urine at it. It is usually strong-smelling and unmistakable, even to humans. This is done as a means of communicating with other cats. It is sometimes known as "marking territory" because that is in fact what the cat is doing: identifying the area as his own.
According to the ASPCA, cats spray to advertise when they are looking for a mate. Male cats who are not neutered do this instinctively, especially if he smells the presence of a female who is not spayed.
Neutering typically stops spraying in male cats. This is because it is partly related to reproduction, which is why males spray around females. Since neutering makes a cat sterile and removes the drive to reproduce, it makes him highly unlikely to spray. However, cats can also spray for other reasons. Changes to his environment can also motivate spraying.
While spraying is most common in males who are not neutered, even those who are might occasionally spray. This can be a result of a change in his environment, such as the addition of a new cat, even a female one. Cats are territorial creatures, so new cats in their homes can be perceived as a rival, even if he is fixed and the newcomer is not the same gender.