On every tick it calculates the difference between the previous touch position and current touch position. Then moves the sprite 1/3 of that distance. If you want sharper control, increase the value (0.3) in the lerp function.
"Subtract diffX/50 from diffX" is used after the touch has ended to continue moving the sprite with deceleration. If you change it to diffX/10, it will stop sooner.