I think frameworks can change the programming model whereas a library cannot.
So a runtime like Akka is really a framework (note also has a state machine abstraction) , but there is no real way you can add the actor model without giving up execution control. Similarly, React gave a declarative programming model to the imperative DOM. Not sure if its possible as a library (it kinda of is a library until you hit the JSX bit)
Programming languages don't compose either. I see frameworks as a less drastic version of a language change. They can fundamentally change the whole programming model. They change a programming language into a different programming language, but without changing the syntax (React did change the syntax too tho) or access to the ecosystem libraries.
So sometimes a thing needs to be a framework, but you should use the least powerful thing to achieve your needs. If it can be done as a library then do it as a library.