As history now bears out though markets are only efficient for producing/distributing certain types of goods (predominantly luxury goods and anything related to computing.) and are often terrible at pricing externalities (such as environmental pollution.)