Nina Raine's new play deals with the knotty, tricksy issue of consent. It's a topic you'd think was simple enough: if someone doesn't willingly give something then it can't – mustn't – be taken. Except, as we see in so many news stories of rape cases in courts across the world, it often doesn't seem to be that simple. In this funny, pointed and complex piece, we see how all the differing shades of consent can be exploited easily and without a second thought by the legal profession.

Kitty has just had a baby, fairly begrudgingly, with Ed, who now wants another one. Over the course of the play, set mostly in their new chic pad in Lewisham, we watch as their lives, and the lives of their lawyer friends, come undone and then get rearranged. Ed (a brilliantly slippery Ben Chaplin) is a 'human rights' barrister who mainly takes on cases for Google and BSkyB, because there's not much money in your average human rights case. When he finds himself defending opposite his friend – and rival – Tim in a rape trial, Ed ruthlessly pursues and pushes in order to win.

The scene where Ed cross-examines the 'witness' – in this case a rape victim – is a hard one to watch. She's raw and angry, he's cold, cool and calculated. There's no empathy from Ed here, something Kitty – a superb Anna Maxwell Martin – points out Ed has none of in his personal life either. But it's a scene which must take place a lot in courts: the woman alleging rape has her sexual proclivities, background and mental health poked and prodded and left on display. Perhaps it has to be like that, perhaps it doesn't. But what Raine so deftly displays is how easy it is for vulnerable people to be on the receiving end of a miscarriage of justice.

Though that case impacts – quite fundamentally in a central scene of the play – on the lives of Ed and Kitty, Consent isn't really about this one case. It's about marriage and a wider issue of giving and taking. Ed has cheated on Kitty in the past and she can't forgive him; their friends Jake and Rachel struggle when Jake has an affair and their marriage hits the rocks. When Kitty gives Ed a dose of his own medicine a shitstorm blows up and Ed and Kitty find themselves on the other side of the law.

Raine's writing crackles with a sharp-tongued and witty energy. Every line is measured and well-balanced, offering a sure-footed and somewhat galling examination of people, with all their horrendous faults on show. In the first scene, Kitty and Ed's baby is brought out – a real baby, no less. It's a smart move which reminds us of the impact we have on the kids and asks us what are the lessons we are teaching?

It's an ensemble cast and each of the performers are a delight to watch. Chaplin and Maxwell Martin together are the piece's beating heart and they are each excellent. Daisy Haggard and Pip Carter as two friends Tim and Zara also work very well within the ensemble, while Adam James and Priyanga Burford offer strong support. Roger Michell's co-production with Out of Joint is slickly staged, and puts the audience on all sides of the action, so we act as judge and jury. The characters occasionally appeal directly to us – in one instance we are the real jury. It brilliantly puts forward that it is we - whether in the court room as a jury or in the decisions we make and actions we take – who are responsible for the lives of others. It's a case well made.

Consent runs at the National Theatre until 17 May.