Coils in a tattoo gun serve as the driving force behind the needle's movement. When electric current flows through the electromagnetic coils, they create a magnetic field that moves the armature bar. The armature bar, in turn, drives the needle up and down into the skin. The coils are responsible for converting electrical energy into mechanical energy, which allows the tattoo artist to create designs on the skin.