Supposedly it was more complicated than just for a family member. I could not remember who exactly it was for, if anyone specific, and found this.
Why Did J.R.R. Tolkien Write The Hobbit?.
The early 1930s represent a period of great experimentation for Tolkien. He quickly drew
The Hobbit into the world of his evolving “Silmarillion” mythology but also ultimately excised the most immediate references. That is, by the time the story was fully told it was no longer connected to Beleriand and the events of “Lay of Leithian”/”Beren and Luthien”. The story underwent radical expansion and revision, perhaps due to the various interludes when Tolkien could not work on the tale.
So although Tolkien certainly developed the story with his children in mind, he also used it as an opportunity to experiment with new ideas and concepts. He also drew upon new influences for his myth-making, such as (probably) incorporating Slavic names into his growing lexicon. According to Rateliff’s analysis, the Laketown of
The Hobbit also represents Tolkien’s only use of High Medieval culture in what eventually became the fictional Middle-earth of
The Hobbit,
The Lord of the Rings, and
The Silmarillion. It may be that Tolkien also began to adopt Gothic and other east Germanic elements into the stories at this time.
Hence, Tolkien wasn’t merely interested in devising a story for his children. He was always making up new stories to entertain them (“The Father Christmas Letters” are contemporary with this period; and
Roverandom is slightly older). He appears to have been experimenting with ways of adapting his mythic constructions to further uses, and at the same experimenting with non-English traditions. The heavy Norse influence on the book in terms of characters (Dwarves), places (Mirkwood), and monsters (Trolls) has not escaped notice.