She was the Rothschild heiress who shocked her family by living with, and going to jail for, a giant of jazz. Richard Williams on the woman who bewitched Thelonious Monk

When Kathleen Annie Pannonica Rothschild, wife of Baron Jules de Koenigswarter, discovered that she loved jazz musicians, it changed her life - and theirs. She paid their rent, redeemed their instruments from pawn shops, bought their groceries, ferried them to gigs in her silver Bentley, and invited them to share her home when times were tough, which was often. "I could see that an awful lot of help was needed," she once said. "I couldn't just stand there and watch."

In the face of her family's disapproval, she provided support to musicians both prominent - among them Charlie Parker, Sonny Rollins, Charles Mingus and Art Blakey - and obscure. The one with whom her name became inextricably linked, however, was Thelonious Monk. She fell in love with the music of the high priest of bebop in 1952, when she heard a recording of his classic composition Round Midnight, and two years later - when he was 34 and she was 40 - they began a relationship whose essence continues to defy analysis, and which ended only with his death.

Nica, as the musicians knew her, was born in London in 1913, the youngest of the four children of the banker and entomologist Charles Rothschild. He named her, she said, after a rare butterfly that he had identified on a visit to the family estate of his Hungarian wife. In The Jazz Baroness, a new 75-minute documentary made by Nica's great-niece Hannah Rothschild, we learn that the Pannonica is in fact a moth - "with yellow wings that look as if they've been dipped in Chateau Lafite," Rothschild notes. Nica's father, who suffered from depression, committed suicide when she was 12 and about to embark on an adolescence that to a Rothschild girl could only represent, as she would write, "a waiting room for marriage and motherhood".

A talented artist, at 18 she was studying art in Munich. In her early 20s, she learnt to fly, and in 1935 married Jules, a fellow aviator. They lived in a chateau in north-west France, where Nica gave birth to two children, Patrick and Janka. The outbreak of the second world war prompted the baron to head for Africa, where he planned to join Charles de Gaulle's Free French army. Nica left their children with friends in New York and joined her husband, serving as a cipher agent in Ghana and the Congo, and later in north Africa, Italy and France.

When the war ended, the baron became a diplomat, first in Norway then in Mexico. They had three more children - Berit, Shaun and Kari - but, her granddaughter tells us, "Nica had trouble adapting to the demands of life as an ambassador's wife", and in 1952 the couple separated. Nica moved to New York; in 1953, Jules became France's ambassador to the US and Canada.

Three years later, divorce proceedings were instigated after Charlie Parker died in her apartment at the Hotel Stanhope on 5th Avenue. The great bebop saxophonist had stopped by en route to a gig in Boston, but began to cough blood. A doctor advised rest, and for Nica there was only one solution: he should stay put. Three days later, while they were watching a variety show on TV, he half-rose from his chair, slumped back, and died. Nica's family were appalled by the screeching tabloid headline: "Bop king dies in heiress flat."

Jules was given custody of the three youngest children, although Berit and Kari would later spend time living with Nica. She was not, it seems, a negligent mother, but her priorities lay elsewhere, mostly with Monk, who wrote angular, abrupt melodies that were often dissonant but sometimes glowed with a brusque tenderness. A tall, imposing figure, he wore funny hats, spoke little (at least to reporters) and often rose from the piano stool to execute a strange lumbering dance.

He already had a wife, to whom he dedicated Crepuscule with Nellie, the loveliest of his ballads. Somehow Monk, Nellie and Nica formed a ménage whose primary purpose was to sustain the great composer and bandleader's ability to function in the face of problems that would probably be diagnosed today as the consequence of bipolar disorder. "Nellie needed Nica to help her cope with Monk's mental instability," says an interviewee in the film. The question of what Nica needed is rather harder to answer, but she certainly responded to the puzzle of Monk's music. "She got it," the pianist's son, Thelonious Jr, tells Hannah Rothschild. "He loved her for that." The pair became a familiar sight in New York clubs, with her Bentley parked at the kerb outside.

But the spectacle of a white woman consorting with a black man in the 1950s was enough to provoke unpleasant incidents. She was driving Monk and his saxophonist, Charlie Rouse, to a gig in Wilmington, Delaware, when, during a brief stop, a policeman searched the Bentley and found a small amount of marijuana in the boot. Knowing that a conviction for the musicians would mean the loss of the police permits that allowed them to perform in New York's nightclubs, Nica took the rap, spent a night in the cells and received a three-year jail sentence, which was eventually overturned.

A few years later, unusually, she stayed behind in New York when Monk left for gigs in California. His mental problems sometimes brought on severe depression, and it was in San Francisco that, without Nica to intervene, he was confined and subjected to electro-convulsive therapy. "It works," the trumpeter Eddie Henderson, a qualified psychiatrist, says in the film. "They're not depressed again. But they're not the same."

Tired of being invited to move on by hotel managers who did not like the idea of jazz musicians trooping in and out of her apartment, eventually Nica bought a house (a modernist assembly of battleship-grey cubes originally built for the film director Josef von Sternberg) in New Jersey, with a view of the Manhattan skyline across the Hudson river. There she installed the Steinway piano she had bought for Monk, along with her cats - more than 300 of them.

Monk hated the cats, but in 1973 he and Nellie moved in with Nica. His health deteriorating, he emerged for only a handful of appearances, the last of them in 1976. He died in 1982, aged 64. Six years later, Nica, by then 75 years old, did not survive a triple-bypass operation. Her generosity, however, did not die with her. The house, owned by her heirs, has been occupied for the past 20 years by Barry Harris, another pianist and loyal friend.

Her five children are scattered around the world: Patrick deals in mineral fossils from bases in the Philippines and France, Janka lives in Israel, Berit is a printmaker in New York, Shaun is a banker in Paris, and Kari is a landscape painter in Scotland. Their father died in Spain in 1995.

Several years after Nica's death, her letters were discovered among the papers of the pianist Mary Lou Williams, another close friend, along with several of her exquisite abstract paintings. Extracts from the letters, read by Helen Mirren, are heard in the film, including this verdict on her marriage: "My husband hated jazz. He used to break my records when I was late for dinner. I was often late for dinner."

When Rothschild began the project, she was hoping the story of her great-aunt would "show me a different way to live my life", and the film is at times a very personal one, leaving no doubt of the difficulties she experienced in persuading her family to overcome their reluctance to discuss the life of a woman who refused to be deterred by their disapproval. There was no such problem with the musicians, whom Rothschild recently described, introducing a screening in London, as "the most dignified, humane and articulate people I have met in 20 years of making documentaries".

Here, then, is the answer for those wondering why the discography of postwar jazz is studded with a single exotic name, in a catalogue of compositions that includes not just Monk's own Pannonica but, from other pens, Nica's Dream, Nica's Tempo, Nica Steps Out, Blues for Nica and a dozen others. For a generation of jazz musicians, it was a way of repaying their most unlikely patron.

• The Jazz Baroness will be shown on the BBC's Storyville series next year. Three Wishes: An Intimate Look at Jazz Greats, a collection of Nica's Polaroids edited by her granddaughter Nadine de Koenigswarter, is published by Abrams, priced £9.99.