Amid the optimism and colour of Queen Mary and King Frederik’s visit down under, a sobering message was carried into the heart of Australian democracy.

“In times of uncertainty, trust is everything. Not only within our society, but also between the nations,” Lars Aagaard, the Danish minister for climate change, intoned gravely to an event of Australian politicians on behalf of the visiting Danish delegation.

“We know now that in this difficult world we’re living in, we need to seek even deeper friendship among countries that share our values and interest.”

The words Trump, Iran and Greenland weren’t mentioned, but they may as well have been. It was a reminder that, for all the pomp and ceremony and public-facing levity of such regal visits, there is often a nugget – or more – of serious diplomacy, of hard-headed politics, at their core which the cheering crowds don’t always see.

Sign up for the Breaking News Australia email

Cheering crowds were not in short supply during the visit – Mary’s first as Danish monarch. Arriving into Canberra just as the famously seasonal capital city snapped out of an unseasonal chilly spell, the royal couple’s 11-car motorcade whizzed up Anzac Parade toward the war memorial on Monday morning. Fresh from a bushwalk at Uluru-Kata Tjuta national park and a state dinner with the governor general, Sam Mostyn, on Sunday, Frederik and Mary laid a wreath at the Tomb of the Unknown Soldier, paused at the Roll of Honour for a Tasmanian-born officer killed in action in 1944 and buried in Denmark, and placed a poppy at the memorial for a serviceman killed in action over Denmark in 1944.

Outside, the best spot for members of the public to catch a glimpse of the pair, well-wishers packed the war memorial’s forecourt. Parents with children, older couples, school groups happy for a morning out of the classroom were among the crowd standing three and four deep at the fence line, many waving paper Danish flags.

One woman arrived in a shirt bearing logos of the 2000 Sydney Olympics – the fairytale behind King and Queen’s meeting, as the then prince Frederik met the Hobart-born Mary at Sydney’s Slip Inn during the Games. “I wanted to see if they remember Sydney,” the woman told a Danish TV reporter, who also noticed her choice of attire.

“They will never forget the Sydney Olympics,” the journalist replied in Scandinavian-accented English.

While meeting the prime minister, Frederik said Danes were ‘very aware of how insecure the climate is in many ways for the coming generations’. Photograph: Hilary Wardhaugh/Getty Images

The King and Queen walked the length of the fenceline, more than 100 metres, shaking every hand they could. Frederik walked in front, but it was clear most in the crowd were there to see his wife; Mary, in a navy dress and fascinator with matching jewellery, was all smiles as she chatted, thanked people for coming, paused for the occasional selfie and patted a dog.

“We love you, Mary!” one person called.

“Welcome home!” yelled another.

Rochelle, with her daughter Anna, said she’d come to see other royal visits to Canberra, including Britain’s King Charles and Camilla, and Prince Harry. Rochelle admitted to “fan girling” over royal visits, likening Australian fans of monarchy to “Beatle-mania”. Monday was Anna’s 10th birthday, and the pair brought a large blue cardboard sign announcing such, hoping the Danes would see it.

They did. Mum and daughter got a handshake and photo, leaving Rochelle ecstatic.

Lynton Martin, a young man from Melbourne, stole the fashion stakes in a royal red blazer, plastic crown and kangaroo print tie. His jacket was festooned with pins and buttons, from the Danish flag and images of the royals, to golden crowns. No Danish heritage, just an interest in the royals had spurred him to drive up solo from Melbourne over the weekend, and to line up for a quick encounter.

Lynton said he spoke to Mary about the Tasmanian AFL team and whether she’d be the number-one ticket holder.

“She was intrigued about that,” Lynton said.

“Maybe [Copenhagen] is their home away from home. They might take some games over there.”

But plastic crowns and selfies aside, there was a more serious tone to the visit. Meeting the prime minister, Anthony Albanese, Frederik said Danes were “very aware of how insecure the climate is in many ways for the coming generations”, saying he would “love to walk hand in hand towards the sunset on that one”.

At a reception event for federal parliamentarians, the speaker of the house, Milton Dick, said Australia and Denmark shared a “commitment to democracy, cultural exchange and a sustainable future”. Liberal MP Angie Bell, who gave part of her speech in Danish after a Rotary exchange to the country in her youth, spoke of Australians finding inspiration from the Nordic country “in community, welfare and sustainability”.

“Denmark and Australia lie far apart on the world map, but we stand close together in values,” she said.

Denmark is at the top of the globe, facing Donald Trump’s attempts to wrest their territory of Greenland in one of his alarming foreign policy interventions. In another, on Iran, Australia is trying to resist being further pulled into the Middle East quagmire by our Aukus partner, but is already facing fuel and inflation from the conflict half a world away.

After speaking about the importance of trust amid uncertainty, of shared values amid a difficult world, Aagaard praised Australia as a like-minded partner of Denmark.

Despite being a world apart, the shared values – and concerns – weren’t hard to find.