The messages would either be played to the judge, or transcribed and provided to the judge. The judge will then write up a lengthy judgment that sets out, in respect of each allegation, what decision has been made, and the evidence for making that decision. That judgment is then published.
There are very, very few court judgments about phone hacking, but there is one from 2022, from a group of claimants against the Mirror Group.
For a taster of the level of detail that would be made public, here's a taster from that judgment. This is why people settlt. Every single allegation is gone into in this detail:
"388. Article 7
Date – 14th September 2003; Sunday Mirror; hard copy and online
Headline – “Angela says the baby is Steve’s…he’s sure it’s not.” (there is also a headline on the front page – “I am having TV Phil’s love child” with a picture of Mr McFadden and Mrs Taggart.)
This story reports that a recent ex-girlfriend of Mr McFadden was expecting a baby and had claimed that he was the father. The article explains that she and Mr McFadden had a relationship during a break in Mr McFadden’s relationship with Mrs Taggart, and had had “an angry showdown” on his doorstep about it. By this time Mr McFadden and Mrs Taggart had resumed their relationship and a purported report from “a friend of the couple” was to the effect that Mr McFadden was having to explain to Mrs Taggart, who wanted to have children with him, why an ex-girlfriend claims he is the father of her unborn child. The source is said to say: “It is a total and utter quagmire. We are talking domestic meltdown.” The article then goes on to draw parallels with the then plotline of EastEnders and then goes into a little bit of history about the relationship with the former girlfriend.
389. In the case of this particular story Mr Evans was able to give express confirmation that it resulted from phone-hacking. He described how he heard a message with details in it during his “daily trawl” of emails, and reported it to Mr Buckley. The message had been left by the girlfriend for Mrs Taggart, and was to the effect that Mrs Taggart might think Mr McFadden loved her but in fact loved her (the girlfriend) and had been sleeping with him for years, and she was pregnant with his child. This came as a complete surprise to the newspaper, which obviously decided to run with it, investigate it and, ultimately, publish."