So in two parts:
First, a guild isn't a company, it's more a union than a company, enabling monopolies (which is why they don't really exist today). In the past, they were enforced by law and by a host of non-competitive business practices. So the blacksmith's guild might not sell horseshoes to...