With the shower head turned off the hot and cold lines are just simply attached to each other. In my RV the cold side has more pressure than the hot side so it actually pushes the hot water back down the pipe toward the water heater, so you get that first few seconds of only cold water once the shower head is turned back on while the hot water is making it's way back to the now open shower head. It's the same reason that many people think their hot water heater is not working when the outside shower is accidentally left with both hot and cold valves open and just shut off by releasing the sprayer head, and now the cold water pressure overcomes the hot water pressure and you can't get any hot water to any of the faucets in the RV. Also why the above mentioned trick of turning the valves off and on instead of the shower handle works better and even the trickle that some showerheads have that try to alleviate the problem don't work as well as they should cause it's not enough flow and the cold water pressure will still build up enough to push the hot water back a ways.