The Queen is the Commander in Chief, is the Head of the Armed Forces, and is the "ultimate authority" of the military. British military officers and enlisted personnel swear allegiance only to the Monarch (and not the Prime Minister or Parliament).
By exercise of Royal Prerogative powers, the Queen delegates the management of the British military to the Prime Minister and the Secretary of State for Defense.
As I understand it, the British Prime Minister is require by law to get the Queen's permission prior to the nation going to war.
I think you misunderstand British constitutional convention. What you are describing -- the Queen granting or denying "permission" -- would cause a constitutional crisis.
As I understand it, by law the United Kingdom can only declare war if the Queen-in-Council issues a declaration. But the Monarch does not by constitutional convention get to veto the Prime Minister's decision to go to war. The unwritten rule is that the Monarch must obey any "advice" the Prime Minister gives them, even up to or including going to war. The old saying is that if the Prime Minister advised the Monarch to sign their own death warrant, they would have to.
The Monarchy is allowed to exist so long as it does not make meaningful political decisions. The Queen is beloved precisely because she does not actually lead the country. She is the focal point for feelings, not for actual policy.
So, yes, by law the Queen-in-Council must issue a declaration of war. But by constitutional convention -- and mind you, in the U.K., constitutional convention has the status of unwritten law and disobedience to such convention would cause a constitutional crisis -- the Queen must obey the Prime Minister's advice to go to war, no matter what she may actually think.
I think she's still on the Canadian money too.
Elizabeth II is separately and simultaneously the Queen of Canada. She is also separately but simultaneously the Queen of Australia, the Queen of New Zealand, the Queen of Jamaica, the Queen of Barbados, the Queen of the Bahamas, the Queen of Grenada, the Queen of Papua New Guinea, the Queen of the Solomon Islands, the Queen of Tuvalu, the Queen of Saint Lucia, the Queen of Saint Vincent and the Grenadines, the Queen of Belize, the Queen of Antigua and Barbuda, and the Queen of Saint Kitts and Nevis. These are all legally distinct thrones as a result of the Statute of Westminster.