When mistakes are made by people or when people are careless that way causing leaking of oil of an oil tanker into the ocean oil spills can occur. Oil spill can also happen if equipment breaks down.
An oil spill is the release of a liquid petroleum hydrocarbon into the environment, especially marine areas, due to human activity, and is a form of pollution. The term is mostly used to describe marine oil spills, where oil is released into the ocean or coastal waters. Oil spills may be due to releases of crude oil from tankers, offshore platforms, drilling rigs and wells, as well as spills of refined petroleum products (such as gasoline, diesel) and their by-products, heavier fuels used by large ships such as bunker fuel, or the spill of any oily refuse or waste oil. Another significant route by which oil enters the marine environment is through natural oil seeps. 
Oil wastes that enter the ocean come from many sources, some being accidental spills or leaks, and some being the results of chronic and careless habits in the use of oil and oil products. Most waste oil in the ocean consists of oily stormwater drainage from cities and farms, untreated waste disposal from factories and industrial facilities, and unregulated recreational boating.
It is estimated that approximately 706 million gallons of waste oil enter the ocean every year, with over half coming from land drainage and waste disposal; for example, from the improper disposal of used motor oil. Offshore drilling and production operations and spills or leaks from ships or tankers typically contribute less than 8 percent of the total. The remainder comes from routine maintenance of ships (nearly 20 percent), hydrocarbon particles from onshore air pollution (about 13 percent), and natural seepage from the seafloor (over 8 percent).Oil spills present the potential for enormous harm to deep ocean and coastal fishing and fisheries. The immediate effects of toxic and smothering oil waste may be mass mortality and contamination of fish and other food species, but long-term ecological effects may be worse. Oil waste poisons the sensitive marine and coastal organic substrate, interrupting the food chain on which fish and sea creatures depend, and on which their reproductive success is based. Commercial fishing enterprises may be affected permanently.Wildlife other than fish and sea creatures, including mammals, reptiles, amphibians, and birds that live in or near the ocean, are also poisoned by oil waste. 
The most damaging oil spill ever to occur in North American waters was the Exxon Valdez accident of 1989. More than most tanker accidents, this one was very preventable. It was caused when an intoxicated captain gave temporary command of the supertanker to an unqualified and inexperienced subordinate, who quickly erred in his navigation and ran the ship aground onto a well known reef. The spilled oil affected about 1,200 mi (1,900 km) of shoreline of Prince William Sound and its vicinity, causing especially great ecological damages in tidal and subtidal habitats. Large numbers of sea mammals and birds were also affected in offshore waters. An estimated 5,000-10,000 sea otters (Enhydra lutris) were present in Prince William Sound, and at least 1,000 of these charismatic mammals were killed by oiling. About 36,000 dead seabirds of various species were collected from beaches and other places, but the actual number of killed birds was probably in the range of 100,000-300,000 birds. At least 153 bald eagles (Haliaeetus leucocephalus) died from poisoning when they scavenged the carcasses of oiled seabirds. 
Petroleum hydrocarbons affect plants chemically and physically. Although plants sometime survive fouling by producing new leaves, even relatively non-toxic oils can stress or kill plants if oil physically prevents plant gas-exchange. Plant sensitivity to fouling varies among species and among populations within a species, age of the plant, and season of spill. Physical disturbance and compaction of vegetation and soil associated with clean-up activities following an oil spill appear to have detrimental effects on the US Gulf coast marshes. Other techniques, including the use of chemicals such as cleaners or bioremediation, may be necessary to address the problem. Clean-up may also be beneficial when timely removal prevents oil from migrating to more sensitive habitats. 
In 1986 more than 8 million liters of crude oil spilled into a complex region of mangroves, seagrasses, and coral reefs just east of the Caribbean entrance to the Panama Canal. This was the largest recorded spill into coastal habitats in the tropical Americas. Many population of plants and animals in both oiled and unoiled sites had been studied previously, thereby providing an unprecedented measure of ecological variation before the spill. Documenation of the spread of oil and its biological begun immediately. Intertidal mangroves, algae, and associated invertebrates were covered by oil and died soon after. More surprisingly, there was also extensive mortality of shallow subtidal reef corals and infauna of seagrass beds. After 1.5 years only some organisms in areas exposed to the open sea have recovered. 
To determine carefully the effects on the marine and estuarine benthos of Number 2 fuel oil spilled by the barge FLORIDA off West Falmouth, Massachusetts, we sampled for many months along an onshore-offshore gradient of pollution, and less intensively at unoiled sites. Analyses of hydrocarbons established that pollution was greatest and most persistent in the intertidal and subtidal zones of Wild Harbor River, less severe in degree and duration at stations farthest from shore. A variety of concurrent analyses showed that disturbance of the fauna was most severe and longest lasting at the most heavily oiled sites, and least severe but perceptible at lightly oiled stations. Patterns of disturbance were not related to granulometry of the sediments. Plants, ctustaceans, fish, and birds suffered both high mortality immediately after the spill, and physiological and behavioral abnormalities directly related to high concentrations of the fuel oil. Five years after the spill its effects on the biota were still detectable, and partly degraded #2 fuel oil was still present in the sediments in Wild Harbor River and estuary. 
Oil spills causes great damage to eco system. The damage dometimes cannot even be repaired and that is what makes it worse. The unfortunate thing is that oil spill mostly happens because of people’s lack of care and attention.
 ”The effects of oil spill and clean-up on dominant US Gulf coast marsh macrophytes: a review” by: S.R. Pezeshkia, M.W. Hesterb, Q. Linc, J.A. Nyman
 ”Ecological Effects of a Major Oil Spill on Panamanian Coastal Marine Communities” by: J. B. C. Jackson, J. D. Cubit et.al.
 ”Anatomy of an oil spill : long-term effects from the grounding of the barge Florida off West Falmouth, Massachusetts” by: Sanders, Howard L.; Grassle, J. Frederick; Hampson, George R.; Morse, Linda S.; Garner-Price, Susan; Jones, Carol C.