The act of writing helps you learn
They say that if you can’t explain something to a five-year-old, then you don’t really understand it. I believe this is embodied in something called the Feynman Technique, a method in which you continually take a concept, see if you can explain it to a five-year-old, use this to gauge your gaps in understanding, and then continue in your studies. Perhaps I have never learned to properly apply this technique, but it’s never worked for me.
Still, I think there’s something to be said about the benefits of writing something out, or explaining it in layman’s terms. This is especially true for subjects that are mostly conceptual in nature, like college introductory biology. Things are a little different in computer programming. In programming, like in math, you can constantly read through and explain concepts without truly improving your ability. The best way to improve in problem-solving subjects is by solving problems.
But even then, writing can be beneficial. The process of problem-solving often involves having to learn new concepts, however broad (like how C++ links libraries) or specific (like how the data flow in the system you work with actually goes). Writing can assist in the learning process, and it can also help to get a better handle on what the problems are and what attempted solutions have been made. The act of writing, by presenting problems and proposed solutions to an imagined observer, also help invoke common sense.
Analogy is powerful. If you can relate something new to what you’ve already learned, you build a mental association in your mind. The more connections you establish, the more easily retrievable the information becomes. This is why people sometimes go at length to describe broader implications, or to make comparisons, or to do deeper analysis. The more time we spend drawing out new connections, the easier the learning becomes.
In summary, there are a few ways writing can help. You can try to write things in layman’s terms. You can try to conceptualize a problem as if presenting it to another person. You can use your time to draw out associations, to do greater analysis, and in this writing get a handle on whatever subject you are trying to learn.
Depending on the subject, though, your mileage may vary.