Suppose that you have a number like 60000 that you want to send over the serial interface, how would you do it when the interface can only send a byte whose value is up to 255 ?
One way is to split the large number into 2 bytes, send them and upon receipt recreate the original number. So, you could send 234 and 96. Upon receipt you multiply 234 by 256 and get 59904. Add 96 from the other byte and you get 60000. This is how val is created in the program.
The program then uses different values of val to control 4 servos. Obviously the program sending the data has to create the numbers and send the appropriately for the servo to be controlled.