Now my question is how does the program know to switch from Case0 to Case1? How does the program know what CASE to pick next?


In your example the Variable Index.HighByte is what it looks at... If Index.HighByte is equal to 0 then in will do the CASE 0;
If Index.HighByte = 1 then it will do Case 1... etc.

Each time it runs the routine, it looks at the value of Index.HighByte. Then it goes down all the cases you have listed and compares Index.HighByte to the case....If it is equal, then it will do that case, and ignore all others.

Dwayne