What is the symbolic contrast between the garden and the enclosed, confined room? Why does the woman herself throw the key away?
The garden represents freedom; in contrast, the room where she is confined represents her confinement, not only literally, but figuratively.
The garden is a beautiful place that is outside of the house, so this represents the freedom she could have. The room she is confined, too, though, is an ugly room, covered in horrible yellow wallpaper. The furniture is sparse and there are bars on the windows. This room is representative of her confinement, both physically and within her own mental illness. She cannot get better because the rest treatment is not working. It is making her mental state worse.
Also, the woman throws the key away because she has completely descended into madness. This could also be symbolic of all hope for recovery being lost. You might have heard the phrase "Lock them up and throw away the key." This phrase, usually used when we think about criminals in prison in some instances, means to never let that person out of prison, to let them languish and suffer their punishment. By throwing away the key, she is going to languish in her own mental illness, it appears, as it has only gotten worse over her time in the room.