"She writes for children and for adults."
Translation:Elle écrit pour les enfants et pour les adultes.
It's because the 'le/la/les' group can refer to either an exact thing that you're talking about, or a generality (or category of things, however you prefer to conceptualize it). The 'du/de la/des' series is for an unspecific/indeterminate amount of something. If je mange des pommes, we don't know how many apples I'm eating. In the most basic sense, it replaces the word 'some'.
Your example is correct as my original explanation was not very clear or complete.
And of course there are still other exceptions and usages for the partitive and other articles.