When other teams come into that stadium or arena, the hometown fans make it rough for them to hear their signals and to feel comfortable playing - unless they manage to silence the crowd with an outstanding performance that effectively takes the crowd out of the mix. This essentially makes it a neutral environment or even one that favors the visitors - for as long as the home team is being outplayed by the visitors.
Another great thing about a home field advantage is that players and coaches know about special places where the ball behaves a little differently because of lighting or footing - or when breezes, air currents, or even temperature differences can enhance a play. Sometimes, the ball will take a funny bounce off certain places on the turf or court. The home team knows this, but the visiting team is surprised by it or not ready when it happens.