There is no magic. There is no layer beyond which we leave the realm of logic and executing instructions and encounter unknowable demons making arbitrary and capricious decisions. Most behaviors in one layer are comprehensible in terms of the concepts of the next layer, and all behaviors can be understood by digging down through enough layers."
It is possible for deterministic systems to become so complex that they are unable to be understood. Physics and most natural sciences encountered this very dilemma early on, determinists posited that the world was a deterministic state machine and that for this reason the future could be predicted with enough study.
This philosophical and physical debate was resolved in the formation chaos theory, which proved that systems can become complex enough that this would be benefit of determinism vanished.