Night-time erections are not necessarily linked to an erotic thought or dream, even if they can often occur during dreaming - it’s a physical reflex. Most men have several each night, they are very important for oxygenating the corpus cavernosum.