"WHY" - What part of speech is it? And can it be removed?

I wasn't sure how to look this up because I'm not sure the part of speech "why" is in this case, and if it was grammatically correct with or without.

Thanks!!!

E.g.

The exact reason why this surname was affixed to them is not entirely clear, except for the fact that they were German.

vs.

The exact reason this surname was affixed to them is not entirely clear, except for the fact that they were German.


The Oxford Living Dictionary has this entry in which there is a definition as a Relative Adverb

(with reference to a reason) on account of which; for which.

With example

‘the reason why flu jabs need repeating every year is that the virus changes’

This is the same sentence structure as your sentence except that yours modifies, or intensifies, "why" with "exact" but this does not change the function of "why"

The English First website gives this explanation of relative adverbs which reads

The relative adverbs where, when & why can be used to join sentences or clauses. They replace the more formal structure of preposition + which used to introduce a relative clause.

It also gives the following example of "why" replacing "for which"

Using "for which"

Tell me the reason for which you came home late.

Using "why"

Tell me (the reason) why you came home late.

So in your case "why" is a relative adverb.

I got the OLD entry by searching for "why define". A dictionary definition is always a good place to start for questions like this.