You plug your code into a framework.
You plug a library into your code.
I think this definition is a good starting point for thinking about the difference between a framework and a library.
I think this definition is a good starting point for thinking about the difference between a framework and a library.