Most people should be able to recognize this toy from their own childhood. This is actually an excellent demonstration of acoustical physics and wave propagation. When used properly, sound can travel down the string virtually without losses.
Sound waves are compression, or longitudinal, waves. If one speaks into a cup, the sound waves of their voice vibrate the back of the cup, which propagates as longitudinal waves down the string to the other cup. The arrival of the longitudinal waves at the second cup then vibrates the back of that cup, recreating the same sound that was input into the original cup.