The key to a ballpoint pen is, of course, the ball. This ball acts as a buffer between the material you're writing on and the quick-drying ink inside the pen. The ball rotates freely and rolls out the ink as it is continuously fed from the ink reservoir (usually a narrow plastic tube filled with ink).
The ball is kept in place -- between the ink reservoir and the paper -- by a socket; and while it is in tight, it still has enough room to roll around as you write. As the pen moves across the paper, the ball turns and gravity forces the ink down the reservoir and onto the ball, where it is transferred onto the paper. It's this rolling mechanism that allows the ink to flow onto the top of the ball and roll onto the paper you're writing on, while at the same time sealing the ink from the air so it does not dry in the reservoir.
Because the tip of a normal ballpoint pen is so tiny, it is hard to visualize how the ball and socket actually work. One way to understand it clearly is to look at a bottle of roll-on antiperspirant, which uses the same technology at a much larger scale. The typical container of roll-on has the same goals a ballpoint pen does -- it wants to keep air out of the liquid antiperspirant while at the same time making it easy to apply. At this scale, it is easy to see how the mechanism works. Here's a shot of the ball end of a typical roll-on:
If you look inside the container, what you have is extremely simple -- the ball is exposed so it can pick up the liquid antiperspirant:
The following two photos show you how the ball fits into the socket:
A ballpoint pen works exactly the same way. The tiny ball is held in a socket, and the back of the ball is exposed so it can pick up ink from the reservoir.
The ball fits into the socket with just enough space to move freely.
The size of a ballpoint pen's line is determined by the width of the ballpoint. A "point five millimeter" (0.5 mm) pen has a ball that will produce a line that is 0.5-mm wide, and a "point seven millimeter" pen (0.7 mm) has a ball that will produce a 0.7-mm line. Ballpoints come as tiny as "point one millimeter" wide ("ultra fine").