The pulley surface is not frictionless so that the string does not slide on the pulley. You can adjust m2 and press play to see how the pulley rotate due to unequal tension on the strings at two side of the pulley.
VIEW or DOWNLOAD ejs xml source
then click to translate strings for selected locale.

Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop.