The reaction proceeds via addition of Grignard's reagent (PhMgBr).
A Grignard reagent is an organomagnesium compound which can be described by the chemical formula ‘R-Mg-X’ where R refers to an alkyl or aryl group and X refers to a halogen.
When C6H4CHOOH reacts with grignard's reagent benzene along with an addition product is formed, which on further reaction with aq ammonium chloride gives C6H4CHOOH.
Here Ph− is a strong base which is extracting proton from the reactant to give benzene.
The reaction is as follows,

Product P is benzene and it has zero hydroxyl group.
