Accepted answer
Concretely, batch testing establishes what can be claimed about the lot as a whole, and the sample size determines how much you can actually claim.
The statistical foundation here is well-established, which is why sampling plans from decades ago are still valid.
If the lot was manufactured in multiple batches, testing vials from each batch separately establishes whether batch-to-batch variation is acceptable.
Sampling plans for pharmaceutical manufacturing are defined in ISO 2859 and ANSI Z1.4, and they are based on statistical sampling theory.
The caveat is that sampling is a trade-off between cost and confidence, and neither test nor assumption is cost-free.
The practical summary: a lot number without a sampling statement is a lot number without meaning.