The bottom line
Topical pain treatments are nearly always preferred to ingested pain treatments. Why? Because of two things: safety and efficacy.
When you consume a pill or powder, it has to pass by your intestines and liver, and has the capacity to harm one or both of those organs. Topical treatments more rarely get into systemic circulation in high amounts, so they’re typically safer.
The efficacy of topical treatments depends on where your pain is. If it’s deep in a joint, topical treatments may not touch it. If it’s muscle-related or involving a joint near the skin, topical treatments may help. In any case, topical treatments deliver substances more directly the affected area, whereas ingested treatments … don’t. That being said, many topical treatments aren’t absorbed well, so efficacy still isn’t super high.