And sometimes it's put in there gratuitously. The most famous example being ET. When Spielberg realized that it would get a "G" rating and would be thought of as a little kid's movie, he re-shot the dinner scene and added Elliot saying "penis breath" so as to purposefully get a "PG" rating instead.
Admittedly that was a pretty stupid line. However I don't think it would have been rated G regardless because of the traumatic elements.