Psilocin is 4-hydroxy-DMT, and psilocybin is just phosphorylated psilocin. DMT is itself just dimethyl tryptamine, which is a modified serotonin. Serotonin itself is itself just modified tryptophan (without the hydroxyl group). The body produces small amounts of DMT naturally, I wouldn't be surprised if that is also the case for Psilocybin. Biochemistry is messy and small amounts of many "unintended" products are created.