This is a rotary machine – it's powered by a motor. As Destin explains, the ink's held between the multiple points, and when they puncture the skin, it drags the ink down into the dermis.
You can have different numbers of needles according to what type of design you're having. The rotations of the motor transform into up-and-down motion on the needle. Coil machines (on the right), by contrast, use an electromagnet with a circuit that is repeatedly broken.