I will preface this post by stating that I am a bit of a beginner to shaders in general. From what I can see in the shader editor, you can have say...the output of a noise node plugged into a colorramp node. This colorramp node can have its output plugged into, say a principled BSDF
So in essence, some shaders HAVE to be evaluated before the others. But exactly how are their evaluations ordered? The way I think about it, Blender would have to take the very first node that has an input powered by another node, say a Noise texture. The noise texture would have to be evaluated first, where it is then passed on as an input to the node it was 'powering'
But how would Blender find this 'first node' in a super branched complex node tree? Does it head recursively through each shader to find their inputs, and to find the inputs of its inputs, until it reaches the 'first one' and evaluates that?