Despite what this website says https://spanish.kwiziq.com/revision/grammar/difference-between-que-and-que-with-and-without-an-accent about the difference between que with an accent on the e and que without an accent on the e, I was told that "que" does not only mean "that." Que means "what" as well, and the example sentence this person gave to prove this point was: lo que me gusta es la pizza. Everything this person told me was: "que without an accent can mean what as in what I like is pizza = lo que me gusta es la pizza." Is what this person said true?
"Que" without an accent is always "that", that is to say, a conjunction or a relative pronoun:
Dice que le gusta la pizza (He says that he likes pizza). (conjunction)
La pizza que más le gusta es la de muzzarella. (The pizza that he likes the most is the one of muzzarella) (relative pronoun)
(Please note I have made a literal translation so that the rendering is as transparent as possible.)
"Qué" with an accent is interrogative "what":
- ¿Qué te gustaría comer? (What would you like to eat?)
"Lo que" is what we call a nominal relative or free relative pronoun standing for "la cosa que" (the thing that), and its translation is nominal relative "what":
- Lo que más me gusta es la pizza. (What I like the most is pizza.)
The distinction between the accented and unaccented forms of qué, cuándo, cuál, cómo, etc. has everything to do with whether or not the word is used to reference something known (declarative) or unknown (interrogative). In English, there are many times when an otherwise question-word is used declaratively. In each of those cases, the Spanish equivalent will be unaccented.
|I like what you have.||Me gusta lo que tienes.||The word "que" is unaccented because it applies to a known item--there is no question in my mind as to what I am referring.|
|Do you know what I like?||¿Sabes lo que me gusta?||The word "que" is unaccented because it applies to something known, and, despite this being part of a question, the question is not "what" do I like--I know what I like. The question is whether or not you know what I like.|
|I don't know what you have.||No sé qué tienes.||Here, "qué" applies to something unknown, and must, therefore, be accented. Even though the sentence is not a question, it contains an implied question. In English, we would say it contains an embedded question.|
|I enjoy watching how you do that.||Me gusta ver como lo haces.||"How" you do that is not in question--I can see that as I watch. Nor is this a question.|
|How did you do that?||¿Cómo lo has hecho?||This is both a question, and the word "how" is a direct part of that question--I don't know "how" you did that, so I am asking.|
|I don't know how you did that.||No sé cómo lo has hecho.||I am making a statement of fact, but the embedded question shows that the "how" is applied to something unknown, so it is accented.|
The same principle applies to other question words. English can use almost any question word in a statement, but if it is applicable to something that is in question, i.e. not known, then you may expect the Spanish translation to have the accented form of the word.
Notice, also, that the word "what" in the English sentences in the table could not be properly replaced by "that," yet in Spanish, the grammar would consider it to be used like a "that" (unaccented "que") whenever it is applied declaratively (to something known and not in question).
(This is more of an intuition-inspiring answer than an exact one.)
There are multiple languages where the word used for a question is an adaptation or a borrowing from the word you would use in an indicative sentence; and this is particularly true with "what" or "that". In Hebrew and Arabic, you have מה and ماذا / ما . Romanian and English and Rench have "Ce" and "What", respectively, which are always used in question form, but can also be used in the indicative: "I'll have what he ordered", i.e. "I'' have that which he has ordered". So, my intuition is that it's basically the same thing in Castillian. And the accent business is just the minor details (though of course you have to take it into account for pronunciation).
PS - The french "Que" is less "reliable" but is still similar to "Ce" and "What" in many cases.