I think FreeType is the go-to solution for text rendering.
http://www.freetype.org/
My take on the word cloud problem:
1. Sort words by frequency. Map the highest and lowest frequencies to some maximum and minimum font size.
2. Render each word into an individual image with FreeType.
3. Find some pleasing way to arrange the word images using only their bounding boxes.
4. Render the word images into a final image, picking a random pleasant color to tint each word as you go.
EDIT: Or did you mean, "how does font rendering work"? In that case, I think it mostly boils down to rasterizing line segments and Bezier curves, along with algorithms for kerning and for trying to fit the text to the pixel grid. FreeType's documentation goes into great detail about what exactly a modern text renderer has to deal with, yet I found it to be very accessible as someone with little prior knowledge of the field. I recommend giving it a look:
http://www.freetype.org/freetype2/documentation.html