Permanent secretary Ursula Brennan and general Sir Nicholas Houghton, vice-chief of the defence staff greet new defence secretary Philip Hammond as he arrives at the Ministry of Defence in October. Photograph: Ian Nicholson/PA

On the same day the Ministry of Defence gave details of another round of job losses across the armed forces, there was another less heralded announcement that had people in Whitehall intrigued.

Ursula Brennan, the permanent secretary of the MoD, is moving to the Ministry of Justice at the beginning of July, less than two years after she took up the post in Main Building.

Philip Hammond, the defence secretary, didn't want her to leave, apparently. She is also popular among the top brass - they like straight talkers, even when they don't like what they're being told. So why is she going?

Brennan has an MoJ background, and there was a vacancy at the department for a new permanent secretary. So, in some ways, it is not a surprise.

She has also had a pretty uncomfortable time in defence, which may have encouraged her to move on when she was approached by the MoJ and asked to return.

Quite apart from the defence cuts, Brennan had to deal with the scandal of Liam Fox and his bestman, Adam Werritty, who kept running into each other on foreign trips. (In 18 months, Fox met Werritty 40 times in the MoD and during visits abroad.)

Brennan had to interview Fox about his dealings with his friend, and helped the then Cabinet Secretary, Sir Gus O'Donnell, conduct an inquiry that was still ongoing when he resigned last October.

All this slightly overshadowed whether Brennan, and indeed other MoD officials, should have done more to warn Fox about his conduct, seeing as anxiety about his friendship with Werritty was an open secret in the department.

The loss of one secretary of state under her watch was just the start. Brennan has also had to grapple with the Whitehall equivalent of a rabid crocodile (the defence budget), and oversee swingeing cuts to the number of civil servants underneath her.

She can't have enjoyed the awkward questions she was asked about the stewardship of the department by MPs on the defence committee.

Brennan gave as good as she got. She also riled some in the MoD over her insistence that the military needed to "get on with it" and promote more women to senior posts.

(She is one of the few women to speak openly about sexism in Whitehall, recalling how there was "still a culture of bottom pinching" in the civil service when she joined in 1975).

After such a turbulent time, a move to a less troubled department might have been expected.

Instead, she is going to the MoJ.

"A place that makes the MoD look like a model of stability," said one defence wag. Brennan, it seems, is genuinely a glutton for punishment.