Theory of the firm: depreciation rather than transaction costs
In the 1930s R Coase tried to answer the question of why commercial or industrial organizations tend to assume the legal form of a corporation instead of a collection of transactions. The point of view is in essence that of the entrepreneur: why hire and manage people, acquire capital partners, and establish supply contracts with external entities instead of treating every interaction as a separate transaction. The answer by R Coase was that negotiating contracts are expensive and attaching one to every transaction is even more expensive, making transactions expensive.
What is notable is that that explanation applies only to the legal form of commercial or industrial organization, not to their economic justification: whether taking the legal form of a chartered corporation with long term contracts with employees and suppliers (an institution), or a flurry of transactions specific contracts, the question remains why businesses are recognizable as organizations in their own right, instead of a mere pattern of transactions, because organizations also do patterns of transactions.
The key reason for the economic existence of corporations is not the cost of attaching a contract to every transaction, but the widespread necessity of depreciation: most commercial and industrial activities require the use of long term and wide scope productive capital that needs to be properly depreciated across multiple periods of time and most relevantly across multiple uses and projects. To some extent that is true of any fixed cost, but the depreciation of productive capital is particularly important because to be performed sensibly over time so that the productive capital endures, that productive capital needs to be attached to some kind of open-ended, wider-scope institution that needs open-ended, wider-scope contracts among its constituents, be they partners, employees, customers or suppliers. Depreciation in other words requires open-ended, wider-scope commitments that cannot be provided on a per-transaction basis, but need a legal form that covers many transactions.
Indeed that need not always be the case and it was not always the common case. For example many commercial and in particular financial economic activities do not involve significantly a requirement to depreciate physical capital and are often organized as patterns of transactions and the legal form of per-transaction contracts.
In ancient times the most common form of commercial organization was the "venture", that is a specific deal for a specific economic activity, such as the buying of a given quantity of silk in the Levant for sale in Europe. Since it involved no depreciation, being closed-ended in time and narrow-scoped to a specific project, it did not require a corporate form. The typical legal form was that of a "commendam", where a number of passive "commendantes" would advance to a "commendatarius" the estimated costs of the venture, and would at the end simply divide the profits (or the losses). The "commendatarius" would then engage in individual transactions to lease a ship, hire a crew for the voyage, buy the silk, hire porters to load the ship, and finally hire other porters to unload the ship on return, and sell the rolls or bales of silk to customers. In other words a buy-and-sell venture, organized as a set of buy-and-sell transactions, with an initial and a final state, and chartered and wound up deliberately and specifically.
Note: today the annual balance sheet and income statements are carried over from that ancient practice, even if corporations are usually based on open-ended, wider-scope charters and contracts with employees and customers and suppliers, but what links them together, which did not happen in ancient times, is depreciation, and indeed it is over it that there are often disputes among stakeholders with different time horizons or scopes.
The problem in that simple picture is the ship: as physical capital used potentially for a long time over many ventures it needs to be accounted properly with depreciation, so that its leasing fee be adequate. In ancient time depreciation was only informally understood, and there was no proper accounting technique for it, unfortunately. As a result often ships were owned by the state or by temples, which were the only open-ended, wider-scope organization around, with an open-ended and wider-scope charter, even if an informal one as a rule.
Note: Depreciation of long-term physical capital is so important that arguably it is the basis of a specific type of state, the hydraulic empire.
Then longer-term wider-scope physical capital became more common, as it was very economically convenient, and states and sometimes temples granted open-ended, wider-scope corporate charters creating organizations that could carry sensibly the depreciation of that physical capital, for example for canals or railways, for which depreciation is an essential aspect, and cannot be resolved simply by a series of specific transactions. Depreciation has to be associated with an institution, not a pattern of transaction.
Note: It may appear that institutions are associated with, more generally, large amounts of physical capital, rather than depreciation as such. But if large physical capital does not need (much) depreciation it can be more easily traded in a pattern of transactions and it requires less (much less sometimes) of an institutional approach than if required depreciation.
Today there are still "ventures" that are organized as set of transactions each with their contract, for example "venture capital" is usually organized as a set of closed-ended (typically 10 years) ventures for specific market segments (to the point that many startups shape themselves consciously as "pure plays" in particular areas), where the investors are the "commendantes", the venture capital company is the "commendatarius", and each funding of a company is a separate transaction, and each closed-ended narrow-scope fund is wound up at the end of its life.