Governments had to create ways to convey these lands to people. The state has to provide some minimal level of collective capital or public goods to facilitate the development of markets when no single individual or firm can afford to do so. Roads are an obvious example. There must be a labor force available to those who wold produce goods and services for the market. Governments participate in the creation of labor in a number of ways of which requiring some minimal level of education is one of the most obvious.
Governments have a role to play in allocating responsibility for what happens in the market.
We define some types of transactions as criminal. But most market transactions take place outside what is defined as criminal. Yet, the consequences of some actions are harmful. Participation in a market economy requires risk-taking. Producers will be somewhat reluctant to undertake the risks of producing new products without at least some assurances that their liability for the unforeseeable and unintended consequences of their actions will be limited.