People usually consume raw mushrooms, teas, or extracts of varying psilocybin content (and likely all sorts of other less desirable metabolites).
After ingestion the stable precursor and prodrug psilocybin becomes de-phosphorylated into its active form, psilocin (4-hydroxy-N,N-dimethyltryptamine), the actual psychotropic agent. Psilocin interferes with human neurotransmission as it binds agonistically to 5-hydroxytryptamine (5-HT)2A and to 5-HT1A receptors. These serotonin receptors are a group of G protein-coupled receptors (GPCRs) and ligand-gated ion channels of the central and peripheral nervous systems. They mediate both excitatory and inhibitory neurotransmission.
The effect of psilocybin on the brain is often dramatic, which explains its use in controlled clinical trials as antidepressant.
X-ray structure model of a serotonin 5HT-2A receptor bound to psilocin