Very ambiguous.
Generally how it works is you submit a proposed purity level to the FDA, with rationale and backup by your own validated analyses.
The FDA dives into it and says “this is reasonable” or “this won’t work” or “based on the chemistry, you need to test for X also”.
Then they require you to “release” any product you make, showing that it conforms to the agreed upon purity. If it fails, they expect you to follow up and figure out why.
Note, most of this is done in good faith - the FDA isn’t repeating the science in a lab, but they pay enough attention that if you’re making things up, it’ll be apparent in the data. The CMC (chemistry manufacturing controls) section of the NDA can be hundreds of pages long.
When it comes to inspections, they are typically random (but if you have a bad track record they happen more often). They can happen any time and they’ll look at all your processes, not just for a specific drug. Don’t have a record that you cleaned your equipment between runs? That’s a paddlin’.
Repeatedly run tests until you get a “pass” result? Yeah, your product will get banned from importation.
But yes, much of the regulation is based on good faith simply because the manpower required to verify everything made would be massive.