Pym was born in Oswestry, Shropshire. She was privately educated at Queen’s Park School, a girls' school in Oswestry and from the age of twelve attended Huyton College, near Liverpool. After studying English at St Hilda's College, Oxford, she served in the Women's Royal Naval Service during World War II. Her literary career is noteworthy because of the long hiatus between 1963 and 1977, when, despite early success and continuing popularity, she was unable to find a publisher for her richly comic novels.
The turning point for Pym came with an influential article in the Times Literary Supplement in which two prominent names, Lord David Cecil and Philip Larkin, nominated her as the most underrated writer of the century. Pym and Larkin had kept up a private correspondence over a period of many years. Her comeback novel, Quartet in Autumn, was nominated for the Booker Prize. Another novel, The Sweet Dove Died, previously rejected by many publishers, was subsequently published to critical acclaim, and several of her previously unpublished novels were published after her death.
Pym worked at the International African Institute in London for some years, and played a large part in the editing of its scholarly journal, Africa, hence the frequency with which anthropologists crop up in her novels. She never married, despite several close relationships with men, notably Henry Harvey, a fellow Oxford student, and the future politician, Julian Amery. After her retirement, she moved into Barn Cottage at Finstock in Oxfordshire with her younger sister, Hilary. In 1980, Barbara Pym died of breast cancer, aged 66. Following her death, her sister Hilary continued to champion her work, and the Barbara Pym Society was set up in 1993. Hilary remained at Barn Cottage until her own death in February 2005. A blue plaque was placed on the cottage in 2006. The sisters played an active role in the social life of the village, and are both buried in Finstock churchyard.
Several strong themes link the works in the Pym "canon", which are more notable for their style and characterisation than for their plots. A superficial reading gives the impression that they are sketches of village or suburban life, and comedies of manners, with excessive significance being attached to social activities connected with the Anglican church (in particular its Anglo-Catholic incarnation). She attended several churches during her lifetime including St Michael and All Angels, Barnes, where she served on the PCC. However, the dialogue is often deeply ironic, and a tragic undercurrent runs through some of the later novels, especially Quartet in Autumn and The Sweet Dove Died.
Her diaries were also published posthumously, under the title, A Very Private Eye (1985) ISBN 0-394-73106-9