hi kak i'm not an expert but i'll try my best to answer (im happy to recieve any corrections from pharm/med experts)
what im picking up from your question is 'how exactly do you evaluate the efficacy of a certain drug, in this case a painkiller, like how you evaluate UX by running user trials' (please correct me if im wrong on this too)
there's a lot of step to developing and researching the efficacy of a drug: molecular level, microscopic, animal trial, clinical trial).
even during the molecular phase they have looked into what exactly it is intended to do in the body (which neural pathway it affects, how it affects the cells, and so on), so if it's meant to kill pain then it's meant to kill pain.
to what degree, it depends on dosage. that dosage too is adjusted to the size of the sample. in the animal phase they look into how much is enough, too much, too little, and some side effects. then it goes on to clinical trial and then looks into what it does to people through a certain span of time.
if it causes nerve damage then the drug needs perfecting, but sometimes they write it off and label it as safe to use under strict supervision, or with exception to super healthy individuals, or suggest prevention of side effects by pairing it with other drugs.
When it comes to pharmaceutics it's kinda dodgy, but a lot of people live by it, and really what other better options are there, so best to treat it with caution