Difference of modules/lib

I was wondering what is the difference in the software architecture between the modules and the lib.
Modules have a task associated while lib are actually well…libraries to be called from modules?