I believe the same bullet (projectile) could be fired from different size rifles. The brass would ID the rifle type.
You said "how do they know it's .223?"
The answer is THEY HAVE INTACT PROJECTILES.
What does that have to do with the rifle that fired them?
The brass would tie down the caliber/load. Markings on the brass might help ID the rifle type, and could even be matched to a particular rifle.