Repellents generally work by taking advantage of an animal's natural aversion to something, and often the thing chosen is something that the animal has learned to avoid (or instinctively avoids) in its natural environment.
Chemical repellents fall into two main categories, odor and taste. The former work better in the warm season and the latter, which ward off an animal only after it eats, in the cold season. (For example, the smell of the lawn fertilizer Milorganite is claimed to make it an effective repellent.) Such repellents mimic natural substances that deter animals and/or are designed to be so irritating to a specific animal or type of animal that it will avoid the protected object or area. Contact plant-origin repellents such as pepper, peppermint, tarragon, garlic, various essential oils, and castor oil, as well as diatomaceous earth and putrescent egg solids, are examples.
Further, some repellents function by inducing fear in the target animal. Such a repellent may contain animal urine, dried blood, or hair. Some animals will avoid anything that has the odor of the urine of their predators.  Tiger urine is thus very effective at keeping away animals. Coyote urine has gained currency as a deer repellent. Fox urine is used to repel rabbits, groundhogs, woodchucks, squirrels and chipmunks. Bobcat urine repels moles, mice, voles and other rodents. Wolf urine is used to repel moose. Used cat litter is also effective. Domestic dogs can be repelled by vinegar.
Other repellents are not chemical. A simple electrified or barbed-wire fence can mechanically repel livestock or predator animals. Some electrical repellent systems have been tested against sharks. High-frequency whistles are used on vehicles to drive deer away from highways, and similar devices are used to deter certain types of insects or rodents. Repellents of this kind for domestic cats and dogs include ultrasonic devices which emit a high-frequency noise that does not affect humans. These types of non-chemical repellents are controversial, both because their effectiveness varies from animal to animal and because there have been few scientific studies conducted to prove that they work. They are, however, safe and humane, as are motion-activated sprinklers and electronic pet barriers, which latter are used by pet owners to confine their own pets to designated areas.
Flashing lights are used to repel lions in Kenya.
The ideal repellent is completely specific for the target animal; that is, it drives away the animal that one wishes to repel without affecting or harming any other animals or people. One type of animal repellent may be effective for raccoons, while another animal repellent may be more effective for skunks. It can be difficult to design a repellent method that drives away only undesirable animals while having no effect on people or other creatures.