system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5.How forensic analysts match a bullet to a gun?

How do ballistics/forensic analysts match a bullet from a victim or found on the scene to the EXACT gun that fired it?? I mean a 9mm bullet can be loaded into any 9mm firearm right? So how do they know exactly which gun that fired it? How do they match it?
gpt
Quite honestly poorly.

Studies in recent years have shown that ballistic analysis is highly flawed and unreliable. 

But to answer your question. The barrel of a gun has grooves etched into it called rifling. These grooves are used to spin the bullet when it is fired. That spin makes the bullet travel straighter. 

The theory is that if you have two bullets fired from the same gun, the grooves created by the rifling should be identical.