The precise type of understanding that is so obvious it won’t be found in scrapes like the common crawl, but is not obvious at all unless you either have a very high level understanding of physics and are modelling everything… or if you are a creature that exists in the world for a while.
Now do metaphysics, just one component of which is:
https://plato.stanford.edu/entries/causation-counterfactual/
PS: this is not currently done in our culture (in the same ways and with the same standards and desire for quality that physics is done), so if you're basing your implementation on prior examples, it will be incorrect. This is not to say that it will be wrong, but it will be incorrect - the distinction between these two seemingly synonymous terms lies within culture.