TL;DR - A guard was behind the attack, plus she goes willingly to bide her time.
We never see the actual abduction on-screen - when the scene begins, there are already six prisoners present (well, five prisoners, one guard), with one holding a knife to Gamora's throat. Although she does show anger when they announce their intention to kill her in the shower room, she does not struggle much and allows herself to be taken there. Keep in mind that, at this point in her life, she is attempting to "turn over a new leaf" and stop being an assassin. This likely means that she was hoping to talk the prisoners out of it, then escape if that didn't work.
Once Drax enters the picture with a clear intent to kill her, she easily disarms her captors within seconds. This leads us to believe that she could indeed have done so earlier, but chose not to.
As for HOW they actually got the drop on her, she was most likely asleep given that the other prisoners are shown sleeping. Even the deadliest person in the world... er, galaxy... can be caught by surprise on occasion. It's how they react to that surprise that defines their skill.
Also, note that the attacker giving the orders is wearing a guard uniform, and is most likely a corrupt guard (with all the access that would entail). This explains how the prisoners were able to get into her cell in the middle of the night.