The Queen isn't the Head of Government. She is the Head of State. David Cameron is Prime Minister of her Government and he is the head of it, even if technically it belongs to her. He runs it in her name.
There are now next to no powers that the Monarch exercises without reference to the Government. Almost all of the things the Queen decides, she does so after advice from her ministers. And most of the Royal prerogatives are exercised by the Government with little consultation (if any) with the Palace.