Cats fight, either in the home with your other cats or out in the community. They have their reasons, it is their way of expressing themselves, showing their discontent. If you can understand this you can prevent future flare ups. Cats are more territorial than dogs, both male and female cats will display displeasure in their personal space being invaded. Hissing and swipes signal a back off effect.
It can become aggressive if they cannot express their message clearly. Similarly to dogs, cats have a social ranking. They will determine the cat hierarchy if you have more than one cat in your home. Watching them closely, kittens play fight, learning and practicing skills needed to be top cat. Commonly cats will work it out for themselves if you allow, you shouldn't need to step in unless absolutely necessary. Making a loud noise, clapping or a quick water spray should do the trick.
Punishment won't work, fighting is part of their natural instincts. Once you understand why they do what they do you can help facilitate their needs.
If you have taken on an abused/mistreated cat their behaviour may be completely different. They can be damaged internally as well as emotionally, making it harder for them to trust people or other cats. Wait until the cat comes to you, they may be confused at first, presenting your hand for a sniff patiently will build the trust.
Sharp, harsh, loud noises and movement my scare the cat and send them skittering to a safe spot. Making this safe go to spot cosy for them is inviting and encouraging to them. Cats will want to push their heads towards things and people, it is a way to mark their territory. By rubbing they will transfer a little of saliva - anything with their saliva on it they consider theirs. What might seem like strange behaviour to us can be easily understood if you remember the cats basic nature.
Natural hunting instincts determine alot of your cats habits. Lying by windows give them perfect advantage to watch for prey or predators. Play fighting and pouncing on moving objects also hone their hunting skills. Keeping them occupied and entertained will keep a happy, healthy kitty.