Most bites/scratches are accidental, caused by stepping on your cats tail, or playing too rough with your dog. Other bites are generally "provoked". In the dog's point of view you teased, scared, threatened, surprised, interrupted or in some other way caused a fear response.
An animal bite is not a statement of the dog's viciousness; it usually indicates that the dog has not been properly socialized or trained. The majority of animals that bite are sexually intact. Spay or neuter your pets.