https://en.wikipedia.org/wiki/Falsifiability
https://rationalwiki.org/wiki/Falsifiability
could be starting points? I dunno. And, yeah, "it's magic" is just a placeholder for a random ad-hoc rationalization that you can make up in any such situation that would explain the given observation while some apparently contradicting claim is also true. The problem is when there is (almost?) no observation that would make you go "ah, ok, I guess this claim is bullshit after all", because you can always make up some story as to why it might not be.