Fun fact:

e-bikes are more climate friendly than human-powered bikes.

5 grams CO2 equivalent emissions per mile e-bike, 40 grams per mile for human eating exclusively bananas. Much, much worse for other dietary choices. Embodied carbon emissions in the bike itself are essentially equivalent.

The Carbon Footprint of Everything (2022)

The carbon in food is not captured or emitted in any coherent sense here. The crops are grown (capturing the carbon in the first place) for the purpose of feeding people -- in the same way that modern American forestry for paper is functionally carbon neutral (ignoring transport and processing) because the trees are in equilibrium. The counterfactual of not eating the food results in fewer crops and basically the same atmospheric carbon dioxide.

Edit: if you only mean food transportation carbon, it seems impossible bananas are literally optimal per calorie.

From the end notes, I think the author's response would be that the carbon equivalent emissions come from the fossil fuel used in growing, fertilizing, harvesting, transporting, refrigerating, packaging, and so-on.

The larger point of the book is that specific accounting is messy, but if we proceed anyway we can get to the rough orders of magnitude that are more useful.

Is this accounting for the production of batteries and electrical components?

That asked, some things I do for myself, and self-propelling is great for my health and longevity.

Yes. I wrote a paper on it a long time ago. Even on the lowest carbon footprint, vegan, diet and even with coal power and even accounting for production and lifetime costs, electric bicycles have a smaller footprint than walking or traditional bicycles. Probably even more so now as the numbers I were using were 20 years ago when e-bikes were not fully enjoying economies of scale.

E-bikes are really power efficient, and food production is very inefficient. Your average American commute probably uses less power per day than a refrigerator.

That said, it’s not really meaningful when comparing to the carbon footprint of driving. Diet and e-bike vs bike just really does not matter compared to the choice of driving an ICE or not driving an ICE. It’s more of just a neat fact.