In popular culture female friendships have often been portrayed either as giggly gossips or as catty and competitive, while girls (and women) themselves are on a quest for an ideal girlfriend - a soul mate who always understands them, with whom they share all intimate secrets and with whom they never argue.

For giggly, think of the Sex and the City quartet doubled over in wicked laugher at the men they take to bed; for catty, think of Lady Edith doing her best to ruin Lady Mary's chances for happiness in Downton Abbey, for the ideal, think of sweetness between the women in Girlfriends; all of these shows have been either written or produced by men; and in all these shows the narrative is driven by the ultimate goal of heterosexual love and marriage.

Now Lena Dunham's Girls offers a series that deftly challenges the centrality of heterosexual romance in women's identity; but the true power and originality of the last series rests in its conceptual transformation of female friendships. Shaping the closely observed portrayal of giggles, gossip, competitiveness and idealisation is a bracing drama about how young women discover and develop themselves in the cauldron of female friendships.

Differences in male and female friendships appear from a very early age. Girls tend to prefer small groups and intimate discussions, whereas boys jostle for status in larger groups. As girls talk to a friend, they learn that their inner worlds are neither crazy nor ridiculous. They discover that even their peculiarities are shared by others, and this provides the comfort of commonality. These are intimate exchanges, and in exposing their innermost thoughts, girls risk criticism of their innermost self, while acceptance builds their confidence.

Girls are haunted by the fear that if a friend is not a good friend, then she is a bad friend, or that if a friendship isn't perfect, then it is awful

The special intensity of girls' friendships – intimate, soul-revealing conversations, declarations of loyalty, swearing to keep one's secrets – generates anxiety about being replaced as your friend's best friend. Throughout adolescence, girls balance their quest for a genuine and open friendship with this need for security and stability in friendship. At an extreme, some may lose touch with who they really are or what they really want as they focus on what their friends expect of them.

Inevitably there is conflict. In fact, when a colleague and I were conducting research on girls' friendships, we were told by one head teacher: "Girls are in my office all day complaining about each other. One day one's feelings are hurt. The next day it's another. I wish I knew how to make this easier for them." And a school counsellor remarked, "The girls aren't violent as often as boys, but they take their fights more personally, and argue more, and come to us constantly about their problems with other girls. It's really hard to help them."

Girls tend to find friend conflict far more troubling than do boys, who accept that you can fight and be friends. We found that girls are haunted by the fear that if a friend is not a good friend, then she is a bad friend, or that if a female friendship isn't perfect, then it is awful. They sometimes chose to distance themselves from a friend if staying close meant exposing and exploring the rifts between them. What Lena Dunham offers is a drama in which the two central girlfriends – Hannah and Marnie – work through the simplistic labels of good and bad friend toward the robust comedy of real friendship.

Girls portrays a pivotal point in female friendships as they become a primary source of social support and self-knowledge in a context where parents infuriate them with their outdated versions of who their daughter is, and when the jobs available to them are out of sync with their aspirations and self-image. Friends can offer a lifeline, but they can also bind us with weights that threaten us with drowning.

Marnie and Hannah infuriate each other with their self-absorption and moodiness and willingness to exploit one another. They are sometimes competitive; they are sometimes nasty; but their lives still depend upon one another, and, anyway, there is no imperative to be nice.

No one else gets this, because everyone else supposes that girlfriends are nice to one another. Marnie's mother is offended when Marnie shouts at her: “I want us to be friends," she protests, but Marnie schools her as to the rough and tumble of female friendship: “I talk way worse to my friends than to you".

Female friendship is not inconsistent with conflict; in fact, real friendship, good friendship offers opportunities to learn how to navigate inevitable interpersonal conflicts. But for friendship to offer this, it has to break free from the old cliché of good friend versus bad friend. In an argument with Marnie (who had sex with Hannah's former boyfriend and, what's worse, didn't tell her) Hannah exclaims with outrage and anger (but also with relief and delight), “Now you're the bad friend - not me!" But we can rely on Dunham to lead us out of the woods here: Hannah concludes, “But you can still be my friend, as the bad friend".

TV series, for better and for worse, provide a scaffold for thinking about the shape of relationships and the norms of interaction. Girls presents a new truthful structure on which we can begin to flesh out a healthy variety of women's friendships, with their perils and pleasures both in focus.