e.g. Tell me what you want.

1. Tell me. + What do you want?

2. Tell me the thing. + You want the thing.

(What is the part of speech of 'what'? Does 'what' come from #1 or #2?)

'what' can be either an interrogative pronoun or a relative pronoun. Here, it's the first one.

I should explain more.

The word 'what' is introducing an indirect question in this sentence; therefore it is an interrogative pronoun.
http://grammar.ccc.commnet.edu/grammar/pronouns1.htm#interrogative

The part of speech of "what" in these sentences is a pronoun. It is used to ask for information or to refer to something specific.

In the first sentence, "Tell me what you want?", "what" is used to ask for the object of desire or interest. It is asking for information about the thing that the speaker wants.

In the second sentence, "Tell me the thing", "what" is not used. Instead, "the thing" is specified, indicating that the speaker is referring to a specific object or topic.

So, the use of "what" in your examples comes from #1, where it is used to ask for information or to refer to something unspecified.