In 1928, the American magazine Liberty published what was to become one of PG Wodehouse's best-loved stories: "Lord Emsworth and the Girl Friend". All the usual Wodehousean suspects are here – the fierce aunt, the overbearing gardener, the uncomfortably stiff collar – and the plot hangs on a characteristically slight thread. Even so, this tale of friendship between a tremulous peer and a 12-year-old East Ender named Gladys has tremendous power.

Emsworth is a character known for his benign indifference. Absent-minded, cowed by those around him, he lives for his prize pig in a world of his own. But when Gladys has a bad afternoon at the Castle, we see a whole different side to the oft-oppressed peer. "Something happened, and the whole aspect of the situation changed."

"It was, in itself, quite a trivial thing, but it had an astoundingly stimulating effect on Lord Emsworth's morale. What happened was that Gladys, seeking further protection, slipped at this moment a small hot hand into his."

Contained but viscerally alive, there is a poignant reserve about this "mute vote of confidence" – the pace and rhythm of the sentences are as subtle as the emotions they convey. It is, Kipling argued, "one of the most perfect short stories ever written".

Countless readers of Wodehouse have testified to the way his novels have their own "stimulating effect" on morale, providing not just comic, but almost medicinal effects: the exiled Kaiser Wilhelm, after his defeat in the first world war, consoled himself by reading Wodehouse to his "mystified" staff; the late Queen Mother allegedly read "The Master" on a nightly basis, to set aside the "strains of the day"; more recently, news reports tell of the imprisoned Burmese comedian Zargana finding comfort in Wodehouse during solitary confinement. "Books are my best friends", he confided. "I liked the PG Wodehouse best. Joy in the Morning – Jeeves, Wooster and the fearsome Aunt Agatha. It's difficult to understand, but I've read it three times at least. And I used it as a pillow too."

Wodehouse was born in 1881, and his early years were, in many ways, highly conventional. His father, Ernest, was "as normal as rice pudding" and determined to give his sons a childhood to match. The only thing conspicuously – but critically – missing was Wodehouse's parents. Ernest had a post as a magistrate in Hong Kong, so the children were billeted with nannies and various relatives in England. Pelham Grenville had almost no parental contact for the first 16 years of his life.

"Looking back," Wodehouse wrote in his autobiography, "I can see that I was just passed from hand to hand. It was an odd life … but I have always accepted everything that happens to me in a philosophical spirit; and I can't remember ever having been unhappy in those days. My feeling now is that it was very decent of those aunts to put up three small boys for all those years. We can't have added much entertainment to their lives. The only thing you could say for us is that we never gave any trouble."

Things in Wodehouse's world are always "odd" rather than "terrible". But sadness seeps through. The Wodehouse children sound like so much unwanted luggage. Perhaps most significant is the thin comfort blanket of amnesia: "I can't remember ever having been unhappy." Even by Victorian standards, this absence was a long one. The separation was to create a coolness between Wodehouse and his mother. "We looked upon her," Wodehouse recalls, "more like an aunt." The fact that there are no extant letters between Wodehouse and his parents, either from his childhood or from his later life, may indicate something about these relationships.

Wodehouse was in many ways his father's son. Despite living through extraordinary circumstances – a self-made man, he married a sometime chorus-girl, spent time with Hollywood movie stars, endured Nazi internment and journalistic accusations of treason – he still kept up the appearance of imperturbable "normality". This was why, perhaps, he was never the most transparent of correspondents. It was Dr Johnson, one of Wodehouse's earliest literary loves, who wrote that a man's soul, "lies naked" in his letters. But Wodehouse's attitude to nudity was a wary one. "You know my views on nudes," he once wrote to a friend, "I want no piece of them." Wodehouse's correspondence is often clad in the epistolary equivalent of Bertie's heliotrope pyjamas, carefully buttoned up to disguise true feeling.

The "cladding", for Wodehouse, has always been his written style. While difficult to analyse (a critic in Punch compared the act to "taking a spade to a soufflé"), there are a variety of figures of speech that recur throughout his fiction, and his letters. One is the way in which he deflects emotion away from the self. When disaster occurs in the shape of income-tax demands or illness, it is the "home" that he metonymically laments. When he expresses admiration for his wife, her outfits – rather than her body – garner the praise.

Such manoeuvres are perfected in his fiction, with his use of the transferred epithet – a technique that casts the state of mind of the protagonist onto a nearby, often unlikely inanimate object. We have, for example, "I balanced a thoughtful lump of sugar on my teaspoon"; "he uncovered the fragrant eggs and b and I pronged a moody forkful"; or the memorable ablutions in Jeeves and the Feudal Spirit: "As I sat in the bathtub, soaping a meditative foot and singing, if I remember correctly, 'Pale Hands I Loved Beside the Shalimar', it would be deceiving my public to say that I was feeling boomps-a-daisy."

The shifting of affect, from mind to limb, is not only absurdly incongruous, it has the effect of holding the emotion in question at arm's (or leg's) length. The pace of this sentence is also ingenious. It suspends its meaning, clause after clause, building up our expectations, till it sinks, like a punctured rubber duck, on "boomps-a-daisy". It is a phrase as unexpected – after the precision of "if I remember", the mystique of "Shalimar" and the rhetorical nod to "my public" – as it is daft. But Bertie isn't even feeling "boomps-a-daisy"; it is part of his charm that his low mood is described not only tangentially, captured in the shape of his "meditative" foot, but through negative inference and euphemism.

Discretion also governs another feature of the typically Wodehousean syntax – abbreviation. Found in both his fiction and his letters, terms such as "posish", "eggs and b", and "f i h s" ("fiend in human shape") create a clubby feeling of intimacy between writer and reader. But there is also something subtly self-deprecating about this shorthand code – as if he is creating a voice that is necessarily compacted, determined not to draw too much attention to itself. As the comic writer Basil Boothroyd pointed out, both Wodehouse's heroes and Wodehouse himself "are vulnerable at heart".

But Wodehouse's pre-eminent stylistic flourish is his use of metaphor and simile: "Ice formed on the butler's upper slopes"; a man "wilts" like "a salted snail" – and one finds the same in his letters. "Things," he tells a friend, "are beginning to stir faintly, like the blood beginning to circulate in a frozen Alpine traveller who has met a St Bernard dog and been given a shot from the brandy flask"; returning to New York, he reflects, "was like meeting an old sweetheart and finding she has put on a lot of weight".

Wodehouse's letters, often written at speed, allow us to see him without his craft in place. Moments of great emotion break through: his excited optimism at the prospect of winning a scholarship to Oxford; his disappointment when he learned that a varsity life was not to be his lot after all; his stoicism in the face of romantic disappointment; his devastation at the death of his step-daughter; his outrage and sorrow at the public response to his wartime broadcasts.

Some of Wodehouse's earliest letters are his most revealing. Recently discovered notes to an Oxford undergraduate, Eric George, aka "Jeames", show him testing, and parodying, the language of love. Wodehouse was still at school, and in a playful allusion to their separation, he shows himself a master of literary drag, impersonating an "hilliterit' female admirer": "My only Jeames," he writes, "life is werry hollow without you." Snatches of contemporary love poetry are offered – "A sigh sent wrong, / A kiss that went astray" – only to be manfully dismissed: "Isn't it rot?"

Wodehouse's dreams of joining Jeames at Oxford were crushed. "[J]ust as scholarship time was approaching," he writes, "it seemed to my father that two sons at the university would be a son more than the privy purse could handle." Wodehouse was sent to work in a London bank and became lost in the maze of early Edwardian bureaucracy. Determined to succeed as an author, he "chucked in" his job, and gained a post with the Globe newspaper.

The next years were spent at a frenetic pace, writing lyrics for musical comedies and news parodies. In 1904, Wodehouse fulfilled a long-held dream to travel to America, bunking up in a cut-price cabin. New York was, he wrote, "like being in heaven without having to go to all the bother and expense of dying". He returned in 1909 and landed some lucrative publishing deals. Letters written on paper swiped from the luxurious Waldorf Astoria show him as a newly confident figure. But beneath the surface, one senses that Wodehouse was often lonely, and dismayed by his short-lived romantic forays. He was apparently sanguine when he failed to win the affections of the actress Alice Dovey, but later letters suggest real heartbreak. "I shall never forget how wonderful she was, with her charm, and her sense of comedy, and her beautiful voice. All the heroines in my books are more or less drawn from her." There are mentions of other attachments. A relationship with a London widow is intriguingly filtered through a correspondence with her 11-year-old daughter; a dinner engagement with another widow – the well-known music-hall artiste, Daisy Wood – and a day-trip with a lady journalist apparently came to nothing. In a surprisingly candid moment, he complains to a friend of life's "infernal" monotony.

There is some comedy in watching this least confessional of writers negotiate an increasingly confessional age. Wodehouse himself was briefly an "agony uncle" for the journal Tit-Bits, and he took delight in the psychology of the public letter writer, teasing those who flaunted their bleeding hearts in print. Wodehouse's own romantic life was sealed by a 1914 meeting with a twice-widowed actress and dancer, Ethel Wayman. A brief courtship was followed by a surprise wedding. "Excuse delay in answering letter," he wrote to a friend, "been busy getting married…!" Ethel was an astute and clever woman. Described as a "mixture of Mistress Quickly and Florence Nightingale with a touch of Lady Macbeth thrown in", she was handsome, long-legged, and intensely sociable. Though Wodehouse's opposite in many ways, she understood him well, and the union was to prove immensely successful. "Married life really is the greatest institution that ever was," he wrote. "When I look back and think of the rotten time I have been having all my life, compared with this, it makes me sick." In marrying Ethel, Wodehouse not only gained a wife. He also "inherited" her 11-year-old daughter Leonora. Wodehouse adored being a stepfather. Indeed, his 1914 satire on the fashion for eugenic family planning (The White Hope) was oddly prescient. Family, for Wodehouse, was forged through love, not genetics. Leonora – or "Snorky" – as she soon became, was far more precious to Wodehouse than any of his biological relations.

Wodehouse and Ethel had little money when they married, but the letters record them being all the happier for their makeshift existence together. This was an intensely productive time for Wodehouse. In 1915, his serial "Something Fresh" was bought by the top "slick" paper, the Saturday Evening Post. A collaboration on a series of hit musical comedies followed. Apart from a touch of writer's block, and difficulties over complex income tax liabilities, these were golden years for him.

Leonora, his "confidential secretary and adviser", proves to be his most important correspondent during these years as he relates the difficulties of getting a small glass of whiskey during prohibition, reports the "low down on the Riviera", and provides the inside story about the theatrical impresario Florenz Ziegfeld. After a brief spell screenwriting in Hollywood ("this place is loathsome", he confides in a letter), Wodehouse settled in northern France. There, surrounded by a brood of animals, he was to produce some of his greatest comic novels.

Throughout the upheavals of the 1930s, Wodehouse, unlike his contemporaries George Orwell and Stephen Spender, kept world events at a remove. Some letters seem to show a weakness of political sense. "A feeling is gradually stealing over me," he writes, "that the world has never been farther from a war than it is at present … I think if Hitler really thought there was any chance of a war, he would have nervous prostration." The year was 1939.

Letters from Wodehouse and Ethel give details of the moment when their tranquil Le Touquet life was shattered as invading Germans surrounded their house. When the Nazis decreed that all enemy males under 60 were to be taken into internment, the 58-year-old Wodehouse found himself caught unawares. "He only had 10 minutes to pack a suitcase," Ethel recalled. "I was nearly insane, couldn't find the keys of the room for the suitcase, and Plum went off with a copy of Shakespeare, a pair of pajamas [sic], and a mutton chop." The correspondence offers a dramatic progression from Wodehouse's stoical postcards in internment camp, bluntly pencilled in slanted capitals, to his 1941 telegram sent from Berlin to the movie star Maureen O'Sullivan (Jane to Weissmuller's Tarzan) and her husband John Farrow, letting them know that he was about to broadcast to America on German radio: "LOVE TO YOU BOTH LISTEN IN TONIGHT".

Seventy years on, Wodehouse's actions in Germany are still repeatedly placed under the journalistic microscope. These letters, together with a complete examination of the MI5 files, show, once and for all, that he was no collaborator. Broadcasting on German radio was, he admitted in a 1946 interview, a "ghastly blunder" – the texts he delivered, written in internment to entertain his comrades, had been intended to boost, not damage, British morale. "It never occurred to me," Wodehouse reflected, "that there could be anything harmful about such statements as that … the commandant at Huy Citadel had short legs and did not like walking uphill, that men who had no tobacco smoked tea, and that there was an unpleasant smell in my cell at Loos prison." What the writer failed to realise was the relationship between the medium and message. He had little sense that a war was taking place on the airwaves, as well as on the ground and in the air. In June 1941, fresh out of an internment camp, Wodehouse had few people to advise him and, without advice, made the worst possible choices. He even accepted a small fee for his broadcasts without, as he later admitted, "realising the implications".

Though channelled through the German treasury, the other sums that Wodehouse received in Berlin were his own personal literary earnings – most of them royalty payments on the sales of his novels in European countries. There are moments when it seems as if the Reich put Wodehouse under pressure, hoping that he would change allegiance. One letter shows him mysteriously asking his agent to transfer a sum of money from his account to that of Edward Delaney (ED Ward), who willingly broadcast for the Nazis.

Elsewhere, he gives an account of a telephone call from the ministry of propaganda. He begins with a tone of chirpily morbid curiosity, noting that the ministry called to ask "if I would join a party of writers who were being taken … to look at the corpses of those unfortunate Polish soldiers who were murdered by the Bolsheviks in 1940". "I had to refuse," he notes, "because of what would have been said in England, but I was very regretful that I couldn't go, as it would have been a great experience." The coda, however, is more wary. "When I heard the offer, I said to myself, 'Ah, they're starting to ask me to do things', but I believe it was just a detached thing and does not mean anything."

Wodehouse's assumption seems to have been correct: there is no sequel to this episode, and we hear no more of the ominous "they" and their propaganda demands. The Nazis, Wodehouse admitted, gave him "the pips", and he was desperately relieved to gain permission to leave wartime Berlin for the relative safety of occupied Paris.

Throughout the war years, Wodehouse's letters record his daily routine of morning exercises, dog-walking beneath looming flak towers, and pacing hotel corridors to work out plots. But there were still some other surprising encounters. His small circle of acquaintances included Hitler's interpreter Paul Schmidt, as well as a sinister-looking, monocled spy called Johann Jebsen. When news of the Schmidt-Wodehouse friendship reached British ears, MI5 asked Jebsen, who was one of the famous "Double Cross" agents, to investigate further. The subsequent report assured the British that the association had no traitorous bent. Ethel, he reported, was "very pro-British", while Wodehouse was "entirely childlike and pacifist".

Wodehouse's most revealing wartime letters are the series that he wrote to Anga von Bodenhausen, an aristocratic widow who took him in as a house-guest and helped extricate him from his broadcasting agreement. In their exchanges, we see Wodehouse writing his way through Berlin's air-raids, fretting about his reputation, and perturbed by the increasing shortage of food. Other letters give us glimpses of Ethel, tracing her time from desultory exile on a trout farm in Lille while Wodehouse was interned, to her life as a resident alien, meeting with film directors to drum up work for her husband, and holding parties for "decorative" British officers.

In the months after August 1944, the French épuration ensued – the punishment of those known, or suspected, to have assisted the enemy. Once again, Ethel and Wodehouse found themselves in danger, as the Comité Parisien de Libération considered whether Wodehouse was, given the broadcasts in Germany, a threat to national security. One night, Ethel reports that she "suddenly woke up and saw a sinister man leaning over my bed with his hat on and his coat collar turned up exactly like a movie. I produced my British passport. Useless. I was told if I didn't dress at once I would be taken in my night gown!" Wodehouse wrote a terrified letter to his friend Malcolm Muggeridge: "We have not tasted food all day. I believe the bearer of this is going to get us some, if he can, but what can he get and where? Can you supply anything. We are absolutely fainting with hunger, & Ethel is on the verge of collapse …"

Muggeridge came to the rescue and Ethel was soon released. Wodehouse, however, was kept under surveillance for a number of weeks before the French realised that he was innocent, and posed no threat. These were dark days, but the wartime correspondence takes its blackest turn when the couple learn of the sudden and unexpected death of Leonora, after a routine operation. "We are quite crushed by the dreadful news," Wodehouse wrote. "I really feel that nothing matters much now."

Wodehouse rarely mentions Leonora again. Her loss is felt throughout the remaining letters – but to articulate it, he later confessed, would have been too painful. Wodehouse may have parodied the modernist poets, but he has more in common with TS Eliot than he might have admitted. For him, as for Eliot, the aim of the written text was not to express, but to "escape" from emotion. It is, as he told a friend, "hopeless to try and put down on paper what one is feeling". The idea of internal psychology, in what he referred to as "the Henry James style", is parodied and resisted.

Generous, loyal, and sometimes astute, Wodehouse nonetheless admitted that he felt himself to be "a case of infantilism. I haven't developed mentally at all since my last year at school." So we see the life in these letters unfold as if preserved in the emotional equivalent of aspic, the juvenile tones emerging at the most unlikely moments. Reflecting on the war, Wodehouse asks: "Doesn't all this alliance-forming remind you of the form matches at school?" adding, "I can't realise that all this is affecting millions of men. I think of Hitler and Mussolini as two halves, and Stalin as a useful wing forward."

Faced with a changing political landscape, Wodehouse does what he knows best – he restyles it. But in a reversal of his fictional technique, this time his similes domesticate rather than distance – it brings the horrors of war home, but leaves the pain behind.

There is something telling about the absence of sentiment in Wodehouse's postwar letters. While forever saddened by his "blunder", he refuses to pay lip service to the all too readily summoned brand of postwar existential shame – what Primo Levi calls "the vaster shame, the shame of the world", finds no place in Wodehouse's articulated emotional repertoire. This is not to say that it wasn't felt. But complex emotion, for Wodehouse, was best played down. Shame, especially, was to be worked out according to the best codes of public-school etiquette, in the privacy of one's mental dormitory. The postwar period also shows Wodehouse recognising that the tenor of his fictional universe rode uneasily with the contemporary moment, with its "welter of sex" and "demand for gloom and tragedy". While his novels preserve their Edenic calm, his letters sometimes seem bewildered or angry. His chief pleasure, he noted, was "writing stinkers to people who attack me in the press".

The letters of his final years are calmer, offering a view into the endearing routine of his domestic life – the round of dog-walking, cocktails and daily soap operas. Ultimately, writing, and his beloved Ethel, were his greatest loves, with the rest of the world kept at bay. In an open letter to some admirers, he admits that his fiction was never intended to fit the criteria of "relevance": "The world I write about, always a small one – one of the smallest I ever met, as Bertie Wooster would say – is now not even small, it is nonexistent. It has gone with the wind and is one with Nineveh and Tyre. In a word, it has had it. But I have not altogether lost hope of a revival."

The beauty of this sentence is that it enacts what it says. In a superlative run of clichés – "gone with the wind", "one with Nineveh", "in a word" – Wodehouse revels in, and revives, the contained sphere of an exhausted language (a "small world" of its own) and makes it a little larger. So it is with the worlds of his fiction. Almost lyric in their perfection, sometimes escapist, but never small-minded, they offer what Adorno called "the dream of a world where things could be otherwise". Right until the end, Wodehouse wrote to preserve the world of innocence he never quite grew out of – and to resist a world he never quite grew into – a ghost of Gladys by his side.

• PG Wodehouse: A Life in Letters, edited by Sophie Ratcliffe, is published this week by Hutchinson

• This article was amended on 7 November 2011 because the original referred to John Farrell, when it should have said John Farrow. This has been corrected.