CodeIgniter allows you to create your own libraries and helpers in circumstances where you don't want or need to place code in controllers or models. Why would you place code in a library and not a helper? Well, some people become quite agitated by the reasoning for this and I'm sure that if you thought hard enough about it, you could come up with some strict rules that defines when a bit of code is a helper or a library. But life is far too short. As long as the code is well documented and is maintainable, stable, and secure, you can do whatever you like. However, as a general rule of thumb:
A library is for code which requires access to other resources, such as needing access to a database, or to an external system (perhaps through cURL), whereas a helper is a smaller bit of code which performs a specific task (such as checking a string being a valid e-mail or for a valid URL, for example).
I'm sure there are better definitions...