Markets provide the efficient amount of a good or service when externalities and public goods are absent.
Externalities in this case refers to an unpredictable occurence such as natural disasters, and public goods refers to the goods that given from the government for lower or higher than the market price