An article in USAToday outlines the program well, but the basic process is that food scraps are collected from area restaurants, processed through tanks full of bacteria to create methane gas, which is then used to produce electricity. The remainder of the food scraps once they have put out all the methane they can are composted and then used for fertilizer in commercial operations.
It is estimated that only 3% of the food scraps in the United States are kept out of landfills by being placed in compost or used for other purposes (we compost at my house, but only vegetable-based scraps). If 50% of the United States’ food waste would go through the process that San Francisco is using, it could power 2.5 million homes a year. That’s a lot of gas. Who knew there were so many food scraps, and that they were so valuable?