Alkaloids are nitrogen-containing organic compounds found in plants that have strong physiological effects. True alkaloids are derived from amino acids and have nitrogen in a heterocyclic ring, while other classes of alkaloids like pseudoalkaloids and protoalkaloids vary in their origin and structure. Alkaloids serve functions like protecting plants from herbivores and can have pharmacological actions like analgesic, stimulant, or respiratory effects when consumed. They are classified based on their chemical structure and pharmacological properties.