Defibrillation of cardiac muscle by the application of a large brief current is used routinely in hosptials to save hundreds of lives daily. Although this technique was discovered in the late 1940's and has been steadily improved since then, until recently there has been no theory describing how or why defibrillation works. In fact, previous theory predicted that it cannot work, even though it obviously does. Within the last few years a theory describing the mechanism of defibrillation has been proposed. This theory exploits the spatial inhomogeneity of the normal heart. However, a substantial controversy remains about the nature of the most important inhomogeneities, with one view favoring large scale inhomogeneities, such as anisotropy and changes in fiber direction, and another favoring small scale inhomogeneities. In this talk, I describe this proposed mechanism for cardiac defibrillation and use homogenization theory to develop a mathematical model that shows when it works and why it fails. I also demonstrate why there is a crucial dependence on the spatial scale of inhomogeneity.