In a letter to his editor, reproduced at Letters of Note, E. B. White explained where the idea of Charlotte’s Web came from, and why a farm is an especially appropriate place to reflect on death and dying:
A farm is a peculiar problem for a man who likes animals, because the fate of most livestock is that they are murdered by their benefactors. The creatures may live serenely but they end violently, and the odor of doom hangs about them always. I have kept several pigs, starting them in spring as weanlings and carrying trays to them all through summer and fall. The relationship bothered me. Day by day I became better acquainted with my pig, and he with me, and the fact that the whole adventure pointed toward an eventual piece of double-dealing on my part lent an eerie quality to the thing. I do not like to betray a person or a creature, and I tend to agree with Mr. E.M. Forster that in these times the duty of a man, above all else, is to be reliable. It used to be clear to me, slopping a pig, that as far as the pig was concerned I could not be counted on, and this, as I say, troubled me. Anyway, the theme of “Charlotte’s Web” is that a pig shall be saved, and I have an idea that somewhere deep inside me there was a wish to that effect.