To be fair the children's story came first. In that regard Tolkien and Rowling had something in common, their first books were written for a much younger and simpler audience. It wasn't until they took off commercially that the more adult and deep lore was developed.
Huh, interesting, I didn't realize Tolkien had started writing portions of the Silmarillion in 1914. I had to do some looking based on your response and learned something.
From what I know, he never really wrote "for" the silmsrillion either. He wrote stories for him to flesh out the history of the world but not with the intention of publishing such stories. Some of them were even just notes about what happened in the world and some weren't finished.
According to the Tolkien Professor (during his YouTube streams on the History of Middle Earth series) there was always the intent to publish the Quenta Silmarillion (the central tale of the Silmarils) as a First-Age story of the Elves, but it kept getting revised and rewritten and never reached a publishable form.
Until Tolkien's son wanted to complete that piece of the legacy, and found multiple (sometimes contradictory) sets of notes and mostly-finished stories, and Editorial Decisions had to be made.