all possible identifications have sequenced examples;
You can trust the a priori identifications of the researchers depositing all of those reference sequences;
Unsampled cryptic intraspecific diversity does not exist within your species that might confound your result, or is not discriminated by your marker of choice;
You can trust an arbitrary threshold to distinguish between "match" (i.e. same species) vs. "not a match" (i.e. not the same species), AND can apply this same criterion ubiquitously (e.g. ignoring rate heterogeneity across lineages);
There is no mitonuclear disequilibrium (hybrid individual may have mtDNA "barcode" of species A, with nuclear genome of species B), or otherwise discordance between your marker (=single locus ancestry) and the rest of the genome;
etc...
No it isn't perfect... But it does provide a hypothesis when species ID is not known a priori...
Maybe this article can help. - https://www.ncbi.nlm.nih.gov/pubmed/15726991
Mitochondrial cytochrome b DNA sequence variations: an approach to fish species identification in processed fish products. Pepe T, Trotta M, di Marco I, Cennamo P, Anastasio A, Cortesi ML. J Food Prot. 2005 Feb;68(2):421-5
all possible identifications have sequenced examples;
You can trust the a priori identifications of the researchers depositing all of those reference sequences;
Unsampled cryptic intraspecific diversity does not exist within your species that might confound your result, or is not discriminated by your marker of choice;
You can trust an arbitrary threshold to distinguish between "match" (i.e. same species) vs. "not a match" (i.e. not the same species), AND can apply this same criterion ubiquitously (e.g. ignoring rate heterogeneity across lineages);
There is no mitonuclear disequilibrium (hybrid individual may have mtDNA "barcode" of species A, with nuclear genome of species B), or otherwise discordance between your marker (=single locus ancestry) and the rest of the genome;
etc...
No it isn't perfect... But it does provide a hypothesis when species ID is not known a priori...
In addition to what Tyler writes (and I subscribe), empirically it seems to me that marine fishes are often successfully identified with barcodes, linking eggs and larvae to adults, etc.
However, this is not always the case with freshwater fishes. I know of several perfectly good species that are not told apart by gene COI.
DNA barcoding is a useful tool, but it doesn't always provide definitive results. If you are conducting a relatively detailed taxonomic assessment of a particular group, then barcoding can be useful for identifying lineages and for flagging potentially cryptic species within the group. If you are just comparing your barcodes with entries in online databases, you need to be careful - some sequences are from misidentified species. Furthermore, if you have any new (undescribed) species in your sample, they might show a close match with congeners in these databases.