You use the scientific method. Make a guess about how the system works, do experiments aimed to show that's not the case, adjust guess accordingly, and repeat
This works only when the inputs and conditions are all the same. In the real world, that isn't really possible anymore for a lot of things, like data sciences operating within a large pulsating mass of live net.