Thanks for your question. The answer is hormones. For people with a penis and testicles, during puberty increases in testosterone levels (along with other hormone changes) lead to changes in the size of their penis and testicles. It also causes sperm production. You may notice sperm in your urine and nocturnal emissions.
Nocturnal emissions is the medical term for “wet dreams.” Nocturnal means at night. Nocturnal emissions are when you have an orgasm or ejaculate in your sleep.
Also, if you get sperm on your bed sheets, washing your sheets in a regular laundry cycle with detergent will get rid of any sperm.