In his three fantasy films set in Japan, Princess Mononoke, My Neighbor Totoro, and Spirited Away, Hayao Miyazaki engaged with traditional Shinto myths and beliefs, but always put his own stamp on them. In contrast to his fellow Studio Ghibli director Isao Takahata, whose approach to Japanese fantasy in Pom Poko and The Tale of Princess Kaguya stuck closely to traditional imagery, Miyazaki's takes on the spirit world involved a mix of original creations and radical redesigns of classical creatures. The kodama tree spirits in Princess Mononoke are one of Miyazaki's most distinctive reimaginings.
To compare, this how Hayao Miyazaki drew kodama...
...and this is how Kodama were traditionally depicted in Japanese art. The old school kodama are humanoid spirits that live inside trees. In The Tale of Genji, they're compared to yokai (demons). Cutting down a tree with a kodama inside is believed to bring about a curse if an offering isn't made; scary stories are told of such trees bleeding when cut down. Miyazaki draws the kodama much cuter and more abstract, like little bobbleheads. They run around the forest rather than living inside the trees. Knowledge of the original kodama myths and the curses they bring, however, does add an extra layer of poignancy and horror to Mononoke's climactic disaster (pictured below).
Princess Mononoke was Japan's top grossing film at the time of its release; it's currently the 6th highest. The kodama are some of its most beloved characters, as one of the few sources of levity in one of Miyazaki's darkest and most serious films. Miyazaki's depiction appears to have influenced the visualization of kodama in other media.
Compare how the tree spirits in Legend of Zelda: Ocarina of Time (in development before Mononoke was released) appear closer to traditional humanoid kodama...
...versus the more Miyazaki-influenced tree spirits in Wind Waker, released later.
Even Shin Megami Tensei, which depicts kodama as demons like in traditional tales, draws them in a notably abstract manner.