A plea bargain is a legal agreement whereby one agrees to accept a sentence in order to gain a concession from a judge or other authority figure. In most cases, the concession is a reduced charge or lessened sentence, or the agreed refusal to impose certain sentences.
Plea bargaining was a Ferengi legal tradition, according to Benjamin Sisko. In 2369, believing it was in the best interests of Deep Space 9 for Quark to continue to maintain the bar, but knowing the Ferengi did not want to stay aboard, Sisko used the fact that Nog was in custody to negotiate a deal – namely, that Quark stay if Nog was released. (DS9: "Emissary")
In 2373, Richard Bashir turned himself in for having illegal genetic engineering conducted on his son "Jules" and agreed to serve time in prison in exchange for Julian's being allowed to remain in Starfleet. (DS9: "Doctor Bashir, I Presume")