Quite simple really. As most anything decomposes it releases methane (the major component of natural gas). Since methane burns well in internal combustion engines, gas or diesel, one with a sufficient supply of organic matter can readily generate enough electricity and an excess of heat to meet their needs, possibly even commercial needs, depending upon the volume of organic matter available for gasification, or digesting as the process is commonly known. The equipment can be as simple as a pair of old oil drums and a truck innertube or as complex as you desire. Google methane digester.