So, many people get it wrong between libraries and frameworks. Today let's break it down quickly.
Libraries
Libraries improve or provide a specific functionality. They solely focus on that single functionality and do not got out of spectrum. Like a library does not try to improve the whole mathematics capabilities of the programming language. It rather tries improve algebra only. In simple words a library can provide a solution to a specific problem that occurs while building an app
Example: Socket io, NumPy
Framework
Framework are similar yet completely different from libraries. Frameworks provide a backbone to build an entire app. They simplify the whole project building process rather than focussing on a single problem. So, they don't have a limited spectrum and they are not as perfect as libraries. In simple words, A framework acts like the whole bone system of your body providing a framework to build on
Example: Flask, Django
Example
As discussed, if the framework if like the whole of the bones of your body, a library is a single organ. Framework provides support while library provides functionality. This is the primary difference between libraries and frameworks
Conclusion
Hope you understand my explanation, If you didn't please tell me what you couldn't understand. If you did, can I get a heart pls.
Anyway, have a productive day ahead