The purpose of existence of alkaloids in plant . their functions in plants is uncertain. There are various views by different authorities, such as they are of no importance and may be regarded as byproducts of plant metabolism. They may act as reservoirs for protein synthesis. They may act as protective substances against the animal or insect attacks. Like hormones, they may function as plant stimulants or regulators in activities like growth, metabolism and reproduction. Or they may function as detoxicating agents by methylating, condensing, and cyclizing the compounds whose accumulation might otherwise cause damage to the plant.
Most of the known functions of alkaloids are related to protection. For example, aporphine alkaloid liriodenine produced by the tulip tree protects it from parasitic mushrooms. In addition, the presence of alkaloids in the plant prevents insects and chordate animals from eating it. However, some animals are adapted to alkaloids and even use them in their own metabolism.  Such alkaloid-related substances as serotonin , dopamine and histamine are important neurotransmitters in animals. Alkaloids are also known to regulate plant growth.  One example of an organism that uses alkaloids for protection is the Utetheisa ornatrix , more commonly known as the ornate moth. Pyrrolizidine alkaloids render these larvae and adult moths unpalatable to many of their natural enemies like coccinelid beetles, green lacewings, insectivorous hemiptera and insectivorous bats.  Another example of alkaloids being utilized occurs in the poison hemlock moth ( Agonopterix alstroemeriana). This moth feeds on its highly toxic and alkaloid-rich host plant poison hemlock ( Conium maculatum ) during its larval stage. A. asltroemeriana may benefit twofold from the toxicity of the naturally-occurring alkaloids, both through the unpalatability of the species to predators and through the ability of A. alstroemeriana to recognize Conium maculatum as the correct location for oviposition. 
Treatment of 2,3,6,7-tetramethoxy-3-chloromethylphenanthrene with pyrrylmagnesium bromide yielded the pyrrole derivative ( 192 ), which was reduced to the corresponding pyrrolidine. The N -formyl derivative of the latter underwent a Friedel – Crafts type cyclization with POCl 3 to the quaternary salt ( 193 ), which was reduced to (±)-tylophorine ( 213 ) (Section ) by sodium borohydride 〈61T(14)284〉 . The constitution of an alkaloid isolated from Cyanetium vincetoxicum has been proven by synthesis: ( 194 ) was heated with PPA, yielding the desired ketone which was reduced to ( 195 ) with sodium borohydride 〈81AP240〉 .