Guinea pigs may seem like friendly and docile creatures, but they can be territorial in the presence of a stranger. Guinea pigs define their territory much like other animals.
Like most animals, guinea pigs use scent to mark their territory. You may see your guinea pig urinating in various spots around his habitat, or rubbing his bottom across the floor or against cage furnishings. This spreads his scent throughout his home, identifying it as his territory. In cages with multiple guinea pigs, the leader of the herd usually handles the marking duties.
If you place an unfamiliar guinea pig in the cage with existing ones, chances are it will provoke a fight as your established pigs defend their territory. Always perform introductions on neutral, scent-free grounds to avoid fights. When the time comes to bring the new member into the shared habitat, clean the cage thoroughly to remove odors, use fresh substrate and replace all the furnishings in different places to make it seem like all the pigs are entering a new cage rather than familiar turf.