Why do people fall asleep?
If you ask about the purpose: we fall asleep for the brain to get a chance to rebuild memories stored during the day and associate these with previously learned things. If you ask about the mechanism: it is not entirely understood. Some parts of your brain work by regularly stimulating and inhibiting each other. This produces a daily cycle of activity. Some structures are responsible for inhibiting those responsible for arousal. You get drowsy and the brain goes into a different mode of action: optimizing memory storage. After the work is done, your arousal center gets stimulated again and “get up and go” hormones enter the bloodstream. You are ready for a new day.