Denis has a nice little collection of links in this post which explain how to use templates. (I haven’t seen how this applies to themes, but I’m a novice.) Thanks for the post, Denis, it collects all those articles together very handily!
Special thanks to Chris J. Davis for putting together the info in the first place!