The yellow "-" minimizes the page to the Dock, the red X pushes the application off the desktop completely, but leaves it running. A sleeping Mac, when wakened, tries to restore the "state" of the machine when it went to sleep, which would include re-initializing all the apps and restoring the state they were in. For Safari, that would mean opening the pages it was tracking at the time. As for why hers does what it does and yours does not, it could be in your settings for how the machine is to react to the lid closing. For example, she may have "Wake for network access" checked on the Energy Saver page of System Preferences, while you may not. So when a network event occurs, her machine wakes up, Safari is restored and you get sounds/images on her machine. If you don't have it selected, then no network events wake up your machine. And, even if you do get a wake up on network access, your Safari pages you had left open may not have videos attached to make noise, or you actually left the page before you closed the lid, so Safari is not tracking any pages. Lots of reasons for the two acting differently.
EDIT: Just to be clear, both the red and yellow have about the same effect, as Safari is still running in both options. The yellow puts the page on the Dock, the red pushes it into what is called the background.