As a general rule for Miyazaki fans, if a scene has anything to do with farm animals, it's probably quoting Heidi. Today's example quotes the first episode of Heidi - an episode that's chock full of riffs. There was a humorous little gag involving a pair of goats that reappear in the third act of My Neighbor Totoro.
This scene from Totoro, in which little Mei gets temporarily lost while chasing her sister, uses the Heidi gag to keep things a bit light. The mood of the film is becoming steadily darker in act three, as the focus shifts to the mother's illness, and how that affects the two sisters. Mei is obviously affected and upset, but she's too young to really understand truly what's happening. Satsuke, the older sister, is old enough to grasp the concept of death, and the seriousness of her mother's longstanding illness.
So this scene we're looking at is part of that steady buildup of tension, preparation for Satsuke's moment of crisis when her sister is suddenly missing. Mei is never in any real danger, and Miyazaki calmly shows the audience that there isn't much to fear. The older sister doesn't get that reassurance. Her fears of loss are suddenly made manifest.
Wow, this piece ended up being heavier than I planned. I just wanted to talk about the goats. This is what I get when I write while listening to Sabbath's Master of Reality and Nirvana's Bleach. At least they sound fantastic on vinyl. Take that, iPod losers! Hah!