The principle, briefly
A mass spectrometer ionises the sample and measures each ion's mass-to-charge ratio with high precision. Modern instrumentation resolves peptide masses to well within the difference a single amino-acid substitution would make, which is why the technique became the backbone of protein and peptide analysis generally.[1]
Every peptide has an exact theoretical molecular weight determined by its sequence: the sum of the residue masses less the water lost at each peptide bond, plus whatever modifications the molecule carries. BPC-157, a 15-residue sequence, comes out around 1419.5 g/mol. If the measured mass matches the theoretical mass within tolerance, the molecule is the one the label claims. If it does not, the purity figure is describing something else.

