This is the the definition and the function of "what" according to oxford learners dictionary
what is pronoun,determiner
< it can be used in questions to ask for particular information about somebody/something, for example:
- What is your name?
- What (= what job) does he do?
- What time is it?
- What kind of music do you like?
or it can be the thing or things that; whatever, for example:
- What you need is a good meal.
- Nobody knows what will happen next.
- I spent what little time I had with my family.
Or it can be used to say that you think that something is especially good, bad, etc. For example:
- What awful weather!
- What a beautiful house!
I think the example of 'nobody knows what will happen next' explains your query as 'what' might refer to certain thing which might be a noun or an object.