One term you need to understand if accused of a crime is “chain of custody”. This comes into play when the police have physical evidence they hope to use against you.
The chain of custody is the term for the history of a piece of evidence from the moment the police collect it up until the moment the prosecution tries to present it in court.
Documentation is key
The police should note down everything that happens to the piece of evidence. They should note down every time it moves from one place to another and every time someone accesses it. If they cannot, then you may be able to ask the court to suppress the evidence.
Why does it matter?
Picture a busy police precinct. Officers are entering and leaving all the time. Between them, they attend multiple crime scenes and search various people and properties. Sometimes they will return to the station with evidence. If they just dump it on the counter or in a drawer, it could easily get mixed up. They could confuse a piece of evidence from one crime scene, property or person with evidence from another. It could end up with a prosecutor presenting a piece of evidence in court against someone who had nothing to do with that piece of evidence. Or a prosecutor presenting evidence that has nothing to do with the case they present it in.
Tampering is another possibility if strict control of evidence is absent. Someone might swap an incriminating piece of evidence into your case or alter an existing, relatively innocent piece of evidence to make it incriminating.
Learning more about this and other defense options can give you the best chance of a favorable result if you face criminal charges.