Hi
Basically compressor have a motor inside(Rotary, scroll compressors) or outside(Belt compressors) , a piston(various types) and many other control and safety components. Compressor motor operate to piston and piston compress the gas(404A, 407A, R22). Compressor motor current waver due to refrigeration and/or cooling conditions.
If you want to know more about refrigeration and it's components... you should study DANFOSS eLearning articles. I think Nothing is outside to DANFOSS eLearning.