It's a common trope on US cop/law shows that prosecutors will offer a deal to criminals in exchange for testimony favouring their case.
Doesn't this give an unfair advantage to the prosecution over the defence?
Consider this scenario. A rich husband is found murdered in his home, prosecution think the wife did it. During the investigation it comes to light that the crime was witnessed by a burglar breaking into a house across the street.
The witness doesn't want to testify. His personal best option is to say nothing since any statement he give will provide evidence of his own crime.
If the witness says he saw the wife commit the murder then the prosecution might agree to overlook his burglary in exchange for his testimony.
If the witness says he saw someone else commit the crime, then the prosecution have no interest in his testimony and have no motivation to overlook his burglary. The defense on the other hand will want him to testify, but can't offer him any deal - the best option for the burglar would be to refuse to testify, or if forced to testify then to deny being present.
Have I understood the law correctly? Or can the defence also offer a deal in exchange for testimony? (Or is it possible that American cop shows don't stick to the truth?)
UPDATE - similar questions involving witness immunity all talk about the prosecution being able to offer immunity for statements that will help the prosecution only. What about statements that will help the defence only?