The tattoo machine looks a bit like a dental drill. It has a needle (sterile), and tube system for the delivery of the ink, a motor, and a foot pedal that works the motor, which is something like the ones found on old sewing machines.
The needle on the tattoo machine (or tattoo gun, as it is sometimes called) moves at between 50 and 200 times a deposits a drop of ink about one millimeter under the surface of your skin. This depth is in the dermal layer, underneath the epidermal surface layer. While the epidermis sheds regularly, the dermis does not. This is why you don't lose your tattoo very easily.