It's similar in the comics and the show, but the details are different.
In both cases, Jessica has taken on her superhero persona (Jewel) and started acting as a costumed hero when Kilgrave runs into her on the street and realizes what she can do. He keeps her captive for several months, forcing her to use her powers for his benefit.
In the comics, Kilgrave sends her out to track down and kill Daredevil, but he's distracted at the time and gives her very vague instructions. She runs into Scarlet Witch, in her red costume, and attacks. The attack seems to snap her out of it, but the Avengers attack anyway. Eventually someone (I think Captain Marvel) figures out that she was under some kind of mind control, and call in Jean Grey to fix it. At that point, they invite her to join the Avengers but she decides to retire.
In the show, they obviously couldn't use the comics story for a number of reasons: Jean Grey is a Fox property, Carol Danvers hasn't been introduced yet, and Jessica Jones seems to take placeseems to take place before Age of Ultron, meaning Wanda Maximoff is still under HYDRA control. Instead, Jessica breaks free on her own after killing Riva and developing an immunity to Kilgrave's control.
In both cases, though, the general concept is the same: Kilgrave sent her out to do something that was so terrible, she breaks Kilgraves control. By then she's so disillusioned with her brief and failed superhero life that she gives it up.