Sometimes it's great to re-invent the wheel. And sometimes it's just not.
A developer may release a framework in some specialized area. She may have spent months, or even years, working on it, and you have insufficient time or expertise to develop a custom solution of your own.
Often, a client will see some fancy UI feature in another app, and add it to the requirements for the app that you are being paid to build.
Some functionality cannot be built by yourself, however skilled you are. Analytics frameworks, for example, are full of proprietary code that is deliberately encapsulated in a framework, and thus hidden from view. Google is happy for you to use their engines, but they don't necessarily want you rewriting their code.