Factory departments and the function

What are two types of departments found in a factory? What is the function or purpose of each?