In order to survive, animals must constantly adapt to changes in the environment. The nervous and endocrine systems both work together to bring about this adaptation. In general the nervous system responds rapidly to short-term changes by sending electrical impulses along nerves and the endocrine system brings about longer-term adaptations by sending out chemical messengers called hormones into the blood stream.
For example, think about what happens when a male and female cat meet under your bedroom window at night. The initial response of both cats may include spitting, fighting and spine tingling yowling - all brought about by the nervous system. Fear and stress then activates the adrenal glands to secrete the hormone adrenaline which increases the heart and respiratory rates. If mating occurs, other hormones stimulate the release of ova from the ovary of the female and a range of different hormones maintains pregnancy, delivery of the kittens and lactation.