"Chain of custody" typically refers to the foundation the prosecution needs to establish for certain types of exhibits to be admitted into evidence.
Exhibits are tangible objects that are relevant to the facts of a case—for example:
Proving that an exhibit being offered into evidence is exactly what it purports to be—the actual drugs found on the defendant or the very calculator stolen from the store—requires proof of who had possession of the exhibit at all times between the time officers seized it and the trial. This is the "chain of custody," and it's especially important when exhibits have been altered in some way or tested prior to trial.
Because criminal prosecutions typically depend on evidence gathered by police officers, it is prosecutors who generally need to establish a chain of custody. In turn, a typical defense strategy is to attack the sufficiency of the prosecutor's chain. If the defense succeeds in preventing the prosecutor from offering an exhibit into evidence, the judge might rule that the prosecutor has insufficient evidence to allow a case to continue. (That determination rests on how crucial the piece of evidence is to the case.)
For example, assume that Hy Immer is on trial for possession of cocaine. To prove Immer guilty, the prosecutor must establish that what Immer possessed was in fact cocaine. The prosecutor offers into evidence the packet of powder that a police officer removed from Immer's pocket. The prosecutor also offers evidence that scientific testing proved that the powder in question is cocaine. To establish the chain of custody for the packet, the prosecutor has to:
Immer's attorney can challenge each and every step in this foundation, but probably won't get far without some kind of indication that there was some kind of irregularity in the seizure-storage-testing-transportation process. If the prosecutor cannot convince the judge that the foundation is adequate, the judge will rule the packet inadmissible and, in all probability, dismiss the case.