Seemingly-irrelevant papers, all with author in common, suggested by reviewer
Think of the review process as a debate between you and the reviewers, with the editor as jury. You would like to convince the reviewers, but ultimately, you want to convince the editor. The editor has called in the reviewers as domain experts so will listen to what they have to say. But ultimately the editor makes up their own mind. It's just that the editor is most likely to give their go-ahead if you and the reviewers come to an agreement. But it's possible that the editor decides to publish even if a reviewer is not positive.
Also, consider that editors are basically the experts on the subject of "reviewers".
I would write three responses. The responses addressed to the reviewers are also passed through the editor (after all, the reviewers are anonymous).
- One to the first reviewer, thanking them for their good advice and noting how you'll apply that. This helps to show to the editor that you're taking the review process seriously.
- A second one to the second reviewer where you explain why you don't think those seven papers are relevant to your paper. Don't put any accusations here, just give your considered, good-faith view on the relevance of those seven papers.
- A third note to the editor only, where you express concern that the second reviewer's review was rather short, that you don't really see the relevance of the papers, and that you noticed that they all have a common author. Ask for the editor's advice on how to proceed.
At that point the editor will probably take a second look at the rather poor quality review, and compare the author list of the proposed seven citations to the name of the reviewer. And advise you on how to proceed.
The editor said I must carry out the essential revisions.
Citing unrelated work is not an essential revision. Only cite what's relevant and explain in your reply why you choose to cite some papers but not others.
You are not obliged to follow all suggestions from the reviewers, in particular not those instructions that make your paper worse rather than better. When in doubt, discuss with the editor; in many journals the form to submit your review has a field for replying to the editor (sometimes called a cover letter). Raise the issue there.
I am writing this as a follow-up given the popularity of this post.
Following the recommendations of the top answer and its comments, I wrote to the editor thanking them and the first reviewer for their invaluable feedback. I then mentioned my "confusion" with the second reviewer, pointed out the author in common, and summarized why I felt the papers suggested were irrelevant to my work. I included a point-by-point response for both reviewers' comments where I said specifically why I found the papers suggested to be irrelevant and addressed the other reviewer's apt suggestions.
The editor recently accepted my paper, and I noticed that the final comments from the reviewers only included the first reviewer. I don't know what this indicates, but I am glad it turned out well! Thank you all for your help with this!