It's not nearly as simple as an affair.
People like to classify it as just an affair, but the dynamic between Andrew Parker Bowles, Camilla, and Charles was not an affair.
There is a longstanding tradition in the British upper classes of men and women marrying based on status, then having extramarital relations with individuals that they were actually attracted to - both men and women did this. There is also a longstanding tradition of Princes of Wales having mistresses who were married; this ensured that the mistress wasn't likely to expect to marry the PoW, provided a "father" for any children from the relationship, and reduced the scandal to the woman (she wasn't an unmarried woman sleeping with a man). The husbands provided a degree of cover for the wives within society, and typically benefited from their wives' status.
Also, reducing Camilla to the status of simply being Charles' friend's wife completely ignores that she had a friendship and sexual relationship with Charles that predated her marriage. Andrew wasn't a friend who's wife Charles was sleeping with, Andrew was the man who was married to the woman Charles had a relationship with.
Camilla's relationship with Charles and Andrew, through the 1970s and up to her divorce, could very likely be described as a Poly one, where in she was with Andrew as a "primary" partner, but with Charles as a "secondary" partner, that in time lead to Charles becoming the primary in what we assume is now a monogamous relationship.
Hey well, that whole 'long-standing tradition' got totally blown out of the water with the advent of the Diana and Charles saga! Not only were our perspectives on fairytale royal romance and happily-ever-after royal marriage changed forever, the British Royal family was rocked a hard one and almost ripped asunder. Thousands of years of royal tradition prevailed but with a vastly different outlook on royal marriage, divorce, crafting a successful public image, dealing with the press, inter-familial relationships, intimate cell phone conversations, how to prep and groom a royal bride, etc.
Of course Charles' relationship with Camilla became a long-standing 'affair,' which began as a youthful dalliance when they were both single. Over time, what started out as a flirtatious attraction grew into a deep and lasting bond of love and friendship. And let's not underestimate the power of Camilla's sexy, savvy, aggressive come-on personality mixed with maternal devotion. Charles did want to marry Camilla when they were both young and free, but her background with other men nixed her chances during that 1970s still old-fashioned outlook on what constituted a suitable royal bride. Charles was not confident and savvy enough to mount a campaign to get his way and wrangle a marriage with Camilla. She got tired of waiting and decided to marry her army officer, Andrew Parker-Bowles.
Charles went on to romance and date others but he never got over Camilla. Eventually he and Camilla reconciled and took up where they'd left off prior to her marriage. In the royal tradition, her husband made no objections. The sticky wicket later on is that Charles chose a young bride who was loathe to go along with these 'long-standing' upper-class and royal British traditions surrounding acceptance of royal husbands having affairs while the wife remained quiet, passive and long-suffering.
One of the problems was the huge difference in age between Charles and Diana, as well as their different interests. They were both needy and selfish romantics, vastly unsuited for each other. Another problem was the antiquated matchmaking notions of their respective maternal grandmothers. The biggest problem, of course, was Charles' deep, long-term love for another woman. Of course Diana had begun to have uneasy suspicions about Camilla well into the engagement, but her sisters had advised her that it was too late for her to back out of marrying. Diana did not become fully aware of the detrimental extent of Charles' emotional attachment to Camilla until the honeymoon cruise.
Fortunately, the one thing that Charles and Diana did manage to do well together was to conceive, cherish, love and nurture their two sons.
Diana, Princess of Wales paid a heavy price for her innocence and her fairytale outlook on love. On the other hand, her rebellious spirit as well as her deep love for her children and her caring for humanity helped change the royal family in many ways for the better.