Much of the recoverable oil reserves are embedded deep underground in shale rock formations. In order to recover this oil the rock must be broken up or fractured which is accomplished by injecting a combination of large amounts of water and strong chemicals and/or gasses under extremely high pressure. After the well is “fracked” the fluids either flow back or are pumped out of the well and the oil separated. The leftover wastewater is then disposed back into the ground through specialized injection wells or allowed to evaporate and seep into the ground in surface ponds. Fracking wastewater is highly toxic and can easily contaminate pure water used in agriculture. Each fracking operation can use up to a million gallons of water.
Read more in this article on fracking and drilling in California.