Secondary metabolites are thought to be biologically active in organisms due mainly to their secondary nature. By the same token, primary compounds are used by every organism so that each idividual should have the molecular machinery to breakdown these compounds (Berenbaum 1995).
Although more than 3,000 alkaloids have been isolated from about 4,000 species of plants, their function and the functions of other secondary compounds in plants is still a topic of debate. Some proposed functions in plants include:
Alkaloids could function as nitrogen waste products like urea in mammals.
Alkaloids could act as nitrogen storage resevoirs for use by the plant in nitrogen limiting situations.
Secondary metabolites could serve as defense for the plant from parasites or other pathogens or herbivores.
Secondary metabolites could serve as growth regulators.
Secondary metabolites may be used to help the plant maintain ionic balance, especially when the roots take up ions from the soil.

Although the debate on function continues, due to their biological activity in many animals, scientists have studied secondary compounds, including alkaloids, from the view that they are defense compounds. Plants are very well represented in the list of organisms which contain secondary metabolites which could be an effect of their life history. Animals are mobile and able to use this trait as a mechanism of defense against many predators. Plants, however, are relatively immobile and thus have had to develope alternative mechanisms for defense (Bell 1981, see Berenbaum [1995] for other supporting arguements).
Secondary compounds, like alkaloids and phenols, have been of interest and have been studied for many years due to their effects (both physiological and psychological) on humans and other animals. Morphine, an alkaloid from the opium poppy, was the first alkaloid to be isolated and crystalized.
Alkaloids