This question already has an answer here:
In the root directory, we can find several 'lib' subfolder, for example,
What are their differences?
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
In addition to shared and static libraries which are the lib-directories main purpose, you may also find some hierarchies (with their own lib, bin, include and so on) for some larger packages under them.