Halliday & Matthiessen (2014: 113):
Thus all WH- groups and phrases have this dual function: on the one hand, as an element in the experiential structure; on the other hand, as marker of some special status of the clause, interrogative (mood) or relative (dependence). These two values, interrogative and relative, are themselves related at a deeper level, through the general sense of ‘identity to be retrieved from elsewhere’; the ‘indefinite’ ones illustrate a kind of transition between the two …
The category of WH- element opens up this semantic space, of an identity that is being established by interrogation, perhaps with an element of challenge or disbelief; or put aside as irrelevant; or established relative to some other entity.