The Polly in the song survives by catching her rapist off-guard. This is because the Polly whom Cobain wrote about was based on a real person, who was kidnapped in his home state of Washington, as described by the A.V. Club

On Northwest Nomad, there's a retelling of these kidnappings, which were perpetrated by Tacoma native Gerald Friend. In 1987, Friend pulled over a 14-year-old girl as she was walking home from a concert, offered her a ride, and quickly brought her to his mobile home, where he tied her to the ceiling and tortured her. Fortunately, after a few days, she managed to escape. Note, however, the plural "kidnappings," as Gerald Friend had not only done these sorts of horrific crimes before, but had been arrested for them back in 1960. Back then, he had been sentenced to 75 years in prison, but was released on parole. Following the 1987 kidnapping, he was arrested again, and sentenced to finish his original sentence, with an additional sentence on top of it.

Cobain read about this in a newspaper, probably the Spokesman-Reviewand was evidently so bothered by the events that he wrote a song. When asked about it, he simply said, "It's an anti-rape song. There's really not much more I can say about it. What can I say?" 

Others have said more than that, however. According to NME, when Bob Dylan heard "Polly" for the first time, he commented "That kid has heart."