They are often chemical extracts of herbs. For instance, ephedra plants might be grown in a greenhose and then harvested. The parts of the plant that contain the most active alkaloids (ephedrine in this case) would be soaked in a solvent in order to remove the ephedrine from the plant. Most herbal medicines likely use an extraction that contains many different compounds from the plant (rather than trying to isolate out and purify just one, like just the ephedrine). This solvent would probably be purified somewhat and than evaporated. The resulting residue would be packed into pills and sold as ‘Ephedra’.
This is a simplified explantaion, but this can be done for any plant or mixtures of plant to create ‘herbal medicines’ (which contain the chemicals from the plant which can affect the human body).