Software is the most complex human-made invention and also the most difficult to debug and secure as the layers of code and abstraction needed to make it work and to make it useful, hide the true inner workings of the raw data
It is possible to guess and estimate probabilities but uncertain to ascertain that a system is completely secure or that a device is completely free of any malware as there is no efficient algorithm that can check every possible path a program can take.
Therefore, it is important to build security measures with this in mind and to adopt a layered defence approach such as Zero Trust Security Architecture in enterprise environments in order to minimise risk, make compromise harder, detect early, and to recover fast.
There will always be uncertainty and it is up to the good guys, who have finite resources, to try and keep up with the bad guys who have an infinite pool of potential maneuvers.