The writing process is very complicated. It involves all the elements needed for reading (attention, propriosenory processing,emotional engagement, organization, exposure to vocabulary, understanding of phonemes and phonics, memory, working memory) plus the mechanics of being able to hold a pencil and print the letters.
In order for the brain to learn it must be able to pay attention and be in its optimum state for learning. The following video is a good one to share with students to explain all this.
Next you have to be able to generate ideas for writing, understand grammar, punctuation, organize ideas and the list goes on and on. The following videos help explain some of these aspects of writing.
If you are interested in learning more about some of the elements of learning to write you may follow the links below to articles and videos which take a more indepth look at this:
General Writing LD info