Elevation governs what shade of “gray” each view should be coloured depending on where they are, more specifically how high they are in the stack or, in other words, how close each view is to your eye relative to other views.
For example, if you have a black background view, then the next view on top of the background must be “lighter” in its shade, and the view on top of that (say a button) must even be lighter than it’s own immediate background view
Only once all view positions and their elevation have been defined then we can intelligently shade each and develop a beautiful 3D effect just by using grays.