Precisely, so the Federation may be anarchist, even though the member races aren’t.
With what we know about how the Federation interacts with other races and planets, real world logic would indicate that the humans could be (and live) the model that the Federation is built upon.
All this is conjecture ofc, and is probably as much an exercise in understanding post-scarcity anarchism as possible Star Trek lore :p
A conceivable way could be to disrupt the nuclear force of the target atoms, maybe like an anti-Pion/Gluon ray that self-propagates the reaction through the released energy.
(As we might remember, splitting the atom yields a bunch of energy, and uncontrolled such reactions go Hiroshima)
It might be controlled by sub-particle lensing, probably some kind of magnetic field, to be active at a specific distance.
For the reaction to be contained, either there’s a radially limiting component (air is not particle dense enough to propagate the reaction, or atoms not energy dense enough) or it’s a cascade triggered by the beam which stops when the beam stops (or the reaction gets too far away from it)
As I believe Pions and Gluons are their own anti-particles, I don’t know how we would go about doing this, but hey, that’s for Science!™ to solve.