In Spirited Away,
Chihiro opens the window for the No Face god. He comes in, and helps her with the bath tags. Later that night, the frog comes looking for gold and he gives him gold, and then swallows him. He starts talking like the frog and asks for food. The next day, he is eating everything and giving gold away. When Chihiro refuses his gold, he gets angry and eats 2 others. In the end, Chihiro uses the stone given by the River God to make him vomit everything out. As he chases her, he vomits the 2 guys he ate, and leaves the spa. Chihiro mentions something like "He's only bad in there!", and when they're in the train tracks, he vomits the frog. He then calmly goes with her and behaves until the end of the movie.
Why did the No Face God have this absurd change of behavior? Going from a calm silent guy to a greedy angry god, and then back?
My interpretation was that he becomes what he eats. In the beginning, he is just a lonely god. Chihiro becomes his friend by letting him in, and he wants to help her, hence giving her the tags. Eventually, he eats the frog (not sure why, but maybe because the frog was a bully of sorts towards Chihiro?), and becomes greedy like the frog. He wants to eat everything, but he still sees Chihiro as a friend. When she refuses him, he gets angry and this rejection, and starts rampaging. As he vomits things out, he becomes normal again.