One of the most important goals of formal schooling is teaching text varieties that might not be acquired outside of school […] Early in school, children learn to read books of many different types, including fictional stories, historical accounts of past events, and descriptions of natural phenomena. These varieties rely on different linguistic structures and patterns, and students must learn how to recognize and interpret those differences. At the same time, students must learn how to produce some of these different varieties, for example writing a narrative essay on what they did during summer vacation versus a persuasive essay on whether the school cafeteria should sell candy. The amount of explicit instruction in different text varieties varies across teachers, schools, and countries, but even at a young age, students must somehow learn to control and interpret the language of different varieties, or they will not succeed at school.
Biber & Conrad (2009:3)
Biber, D., & Conrad, S. (2009). Register, genre, and style (Cambridge Textbooks in Linguistics).