When you start programming/coding in computers, you will come across the need to write some code that needs to be used again and again.
In general a simple way is to write this code as functions and reuse them in your program.
In the field of computing programmers and developers observed that a lot of commonly required code is re-written again and again by people all over in the field of computing. So some decided to pack these pieces of code in pack of single/multiple files organized and categorized for different presuppose.