When to go for a plugin? And when to go for a widget?

When to go for a plugin? And when to go for a widget?


(about to do a presentation on UI Widgets at Barcamp Ghent 2 and want
to have some input on this, just to make sure that I'm not spreading
out some bollocks into the world ;-))
I was wondering: if I were to write a new functionality to use with
jQuery, when exactly would I choose to write a plugin and when to
write a widget?
Take a starrater or a progressbar for example: one could code it as a
widget, but one could code it as a plugin too. What are the advantages
of using either one of the methods?
Thanks,
Bram.