As simple as ballpoint pens appear, they're actually quite the engineering achievement. Basically, there's a barrel that comes in two pieces that houses the reservoir (the ink tube). At the end of the reservoir, there's a tip, and at the end of the tip there's a ball. On each side of the reservoir, within the barrel, there's a spring, and to hold the springs in place are a screw and a clip (one on each end).
What sets the ballpoint pen apart from the pens in the past is the ink. In the past, pens like the quill pen, the reed pen, and the fountain pen used dark India ink. It worked fine, except that it flowed unevenly, took forever to dry and sometimes would dry inside the pen, clogging it up. But in 1943, Hungarian journalist Laszlo Biro came up with the idea to use an ink similar to the ones used by newspapers because they barely smudged, and they dried almost instantly. And to further improve on the idea, he came up with the concept of using a ball at the tip to help distribute the ink more evenly.
The ball is located at the very tip of the pen. It's kept in place by a socket, where it's held tightly, but still allowed enough room to move freely. Gravity forces ink to come out of the reservoir, but the ball keeps it trapped in there--until the ball is rolled, that is. When the ball is rolled across paper, it picks up ink from the reservoir and places it onto the page. The ball also keeps air from getting into the reservoir, which allows the quick-drying ink to stay wet.
On the inside of the pen, there are a couple springs that allow the pen to retract. The first spring (ratchet spring) is located inside the bottom half of the barrel (where the tip comes out). The reservoir is put through this spring before it's put through the open end of the barrel. On the other side of the reservoir, there's a spring that's located inside the upper half of the barrel. This spring (the button spring) is connected to a screw and a clip, which are then connected to the button at the end of the pen. When you press this button, it presses down on the button spring, which then forces the reservoir out through the pen. A locking mechanism consisting of tiny pits and teeth interlock with each other to keep the reservoir out of the pen when it's needed for writing, and when it's retracted back into the barrel, they unlock and the reservoir is sprung back inside by the ratchet spring.