There are many times went you want to add 2D elements to your render, and this is what overlay does: alpha composites an image or sequence of images over the rendered output.
You can specify whether to use the alpha channel of the image you want to composite, or the alpha channel from a different image or sequence.
overlay can be used for utility purposes (adding your name to the corner of each image or animation rendered, for example), or creatively, such as displaying an animated "digital readout" as if viewing through the eyes of some cybernetic hunter. With some planning, you can do animated wipes and fades - the trick is creating a sequence of images where the alpha channel is animated. Using trueSpace itself to create and render animated masks is an easy way to create a variety of effects.