The active compound psilocin, derived from psilocybin, prevents the reuptake of serotonin in the brain, leading to increased concentrations of this neurotransmitter and causing the hallucinogenic effects associated with magic truffles.