An API works by producing a desired therapeutic effect in the body, targeting specific biological pathways or receptors.