Imagine that you are writing a tutorial, or a blog entry, for example. You divided your text in sections and (maybe) subsections. So you think it would be nice to have a table of contents with links to each section and subsection.
One way to do it is to write that table manually. But this approach has a few problems: 1) you have to sort of copy/paste every title name and copy/paste by itself is something that should be avoided1 and 2) in the future if you change the text you will always have to be careful with the table of contents.
Another approach is to use a jQuery plugin to automagically generate the table of contents for you. You just include the plugin, and call it and the table of contents will be there. If you change you won’t have to change anything regarding to