Cats hiss when they are feeling afraid or threatened. This is a way for them to warn off the perceived danger.
This is usually in response to something that has upset them, such as being touched in a way they don't like or being denied access to something they want.
Cats may also hiss if they are in pain. This is a way for them to communicate that they are hurt.
Cats may also hiss to mark their territory. This is usually done by hissing at other cats who enter their space.
When introducing a new cat to your home, it is common for them to hiss at each other. This is a way for them to get to know each other and establish dominance.
Cats may also hiss during play. This is usually a way for them to show that they are not being serious and that they are not trying to hurt you.
In rare cases, cats may hiss due to a medical condition. For example, cats with hyperthyroidism may hiss more often due to the increased stress levels associated with the condition.