It usually happens with laptops. When touch pad has dust particles on its surface or becomes hot, cursor behave abnormally. If you clean touch pad surface, you can control its movement. It also moves freely while used during travel in trains with DC power supply.
The answer is found in the differential performance of optical mouses and conventional mouses. This doesn't occur with the former, and the difference in operation concerns the tendency of the latter to get dirty.