There are some smaller organizations that don’t have or need managers, and function very well. There may be a distinction between “owners” and “employees”, as sailor describes, and perhaps that’s “management” although the day-to-day structure can be very flat.
However, as you add more people, there is more than a single “owner” (or small group of “owner/managers”) can do, and so they appoint one of the employees to manage (that is, they delegate responsibility.) And thus, an organizational structure is born, with workers and managers (distinct from owners.)
Managers’ functions can vary, based on the organizational structure, but often include budgeting, staffing (deciding whether more people are needed), managing people (including hiring new employees, terminating people who aren’t performing, promoting, deciding raises, determining training and development), managing inventory or equipment, finance/accounting, and other functions that may be invisible to you on the shop floor.
Well… what would happen to the productivity data and reviews of the work force? You make a report that says productivity is down, does anyone take action or make decisions about that? You review and workforce and find that Fred is playing solitaire on the computer instead of producing widgets, who makes a decision about what to do about it? What would happen if you needed to hire another person? Suppose that the technology changes, and you find you need a new widget-compressor, who would make the decisions to purchase?
Even in the communist and socialist countries, there was a recognized need for decision-makers who are “more equal” than the regular workers. And, arguably, one of the great failures of the communist system was the inability to manage performance. Poor performers were never disciplined or fired or dealt with, and so quality of production plummeted.
That enough background on “Why managers are needed” for you?