Ronald Coase is famous for his analysis of the role of transaction costs for the emergence of institutions. He explained the emergence of a firm as an institutional adaptation to high costs of coordinating production activities within the market process.
For example, if the production of a Honda Civic was organized exclusively through market transactions, each production activity would have to be performed by an independent individual producer. In such a world, I might be earning my living by buying the Honda civic exhaust manifold on the market, drilling the holes for the screws, and selling it on the market to the person that will connect the manifold to the cylinder of the engine.
The cost of coordinating my actions with the actions of other producers of Honda Civic parts would have to be lower than the cost of coordinating the production activities through administrative decisions within a non-market organization. Part compatibility, sizes, material quality, timing of production and other features of the production process would have to be successfully coordinated within the market. In the end, the last person in the production process would buy an almost finished Honda Civic from the second last person, and this last person would add the last screw, or the last sticker, or whatever the last part would be. This last person would then sell this car to a retailer or to a consumer.
You probably see that this is an unlikely scenario. The number of activities that would need take place for market participants to coordinate the production of a Honda Civic would be overwhelming. It simply makes more sense to get together and organize production as a group, a team. The name we usually give to this team is the firm.
Thus, in a world where the coordination of production activities in the above described example would be so hard to achieve, that it would be nearly impossible to produce a car by independent market participants, people found another way. They coordinate the production activities not through market transactions but through administrative decisions made by managers within a firm. The managers make sure that the part I am making will fit with the part the person on the assembly line next to me is finishing. We obey the orders of the manager and the job gets done.
However, there are limits to a firm. When coordinating production through administrative decisions becomes more costly than coordinating actions through market transactions, firms turn to outsourcing. They may buy some parts from another firm. For example, most car manufacturers buy some generic screws from other firms rather than producing the screws in house.
Notice, however, that the limits of a firm also include how far a firm can go in using administrative decisions in coordinating labour activities. Firm employees have lives outside of the firm. The firm needs to enter into a market transaction with the potential employees and offer them a satisfactory monetary compensation for their services. This means that coordinating production activities through market transactions with labourers is less costly than coordinating production by managing all of the employees' activities 24 hours a day. This implies that employees and employers expect higher payoffs in a scenario in which employees are free to invest their wages in their own capital resources as opposed to their employer providing all capital resources for them. In this sense, freedom is an institution that reduces transaction costs relative to complete employer control over the employees' life.
On the other hand, in a world in which coordinating production through direct command and control is more cost effective, compared to coordination through market transactions, we may expect the development of an institution that resembles slavery. Slaves would live on the property of their employer and all of their activities would be directed by the employer. Notice that "slavery" in this case is voluntary. What is implied is that people don't dislike being told what to do all the time, or, at least, that their dislike is not sufficient to overturn the benefits of higher productivity resulting from being told what to do all the time. In other words, voluntary "slavery" may be the most efficient social arrangement in some cases.