lib dir vs. plugin

I'm still learning about the Rails opinion on where stuff belongs. Can someone explain to me the difference between code in the lib vs. code in a plugin. What scenarios are appropriate for each approach?

Sean

Plugin is *usually* supposed to be 3rd party generic code.

lib is for your own application specific supportive libraries.