Anti-aliasing uses the alpha value(transparency) of a pixel to create blending.

How it works
When you are displaying data in video memory, there are usually four components to each pixel, a value for the amount of red, green, blue and an alpha value for the transparency. You take this alpha value and use it to calculate a transparency value for that pixel. This will mix the background color with the color you are putting on top of it, eliminating jagged edges (actually called jaggies) in pictures.

Pixels that are dark and in the middle of the image have an alpha value of zero, because you want them to show up 100%. However at the edges you assign a slowly increasing alpha value. The alpha value is usually one word ranging from a value of 0 - 255. The very outer pixels of the image you are trying to display may have very high alpha values

Calculation
So, lets say you have a small letter of text that you want to put on the screen, the letter 'O'. In the center of the letter, the alpha values will be really high ~250 so that the background can show through and same with the very outer edges of letter. Directly around the ring which makes up the letter 'O' the alpha values will be very low ~5 so that the text can show up on the screen. Use this formula on each pixel before displaying it on the screen.

(alpha/255) * new_pixel   +    [1-(alpha/255)] * background_pixel = new_blended_pixel

As you can see from this formula, the new pixel is a mix between a portion of each of the original pixels, hence the blending. This can be used in many scenarios like dissolving a picture onto or off of the screen, blending from one screen to another, or smoothing out edges on font characters.