Guns can leave alot of evidence. Registration, caliber, gunshot residue, prints, DNA, blowback and blood spatter. Even the ammunition and having the same lot in your possession.
I heard of an interesting case. A man was thought to have two guns of the same caliber. Wits had seen him with a second gun. But how to prove it?
So the police seized his holster. Their reasoning was that impression evidence must have been left by the missing gun.
The holster was taken apart by the stitching. There were 2 sets of gun impressions; one from the known gun, and one from the unknown.
Firearms units have reference collections with many guns. They can get virtually any gun manufactured. They simply got a copy of the gun in question and compared the marks. They got a hit, and used the match to imply that the suspect has placed the missing gun in that holster.