Jack,
For an account of how the free market emerged despite the regulations and restrictions of the guilds and without the backing of the state (which in most cases took the side of the guilds) see Rothbard’s History of Economic Thought Volume I, Chapters 7-11.