Yes, by the quick and simple explanation that your textbook gives you, it should be "lo que". But that quick and simple explanation is not accurate, as you can perfectly have "qué" in the middle of a sentence, besides "lo que" at the beginning of one as well:
Lo que te quería decir es... que ya no te amo.
What I wanted to tell you is... that I don't love you anymore.
Furthermore, I find it curious that your textbook says "que" alone (without a preceding "lo") can be translated as "what". I can't think of an example where that happens.
In my opinion, a better quick-n'-dirty list of equivalencies would be:
qué = what (for what traditional grammar calls "direct and indirect questions")
¿Qué quieres hacer? / What do you want to do?
Dime qué quieres hacer. / Tell me what you want to do.
que = 1. that (introducing subordinate clauses: "he said that she'd do it", "I recommend that he go to that place"); 2. that (in the construction equivalent to "so...that"); 3. than (in comparisons); 4. (introduces a reason, often left untranslated in English)
Él dijo que ella lo haría. / He said that she'd do it. (1)
Recomiendo que vaya a ese lugar. / I recommend that he go to that place. (1)
Iba tan rápido que se tropezó y se cayó. / He was going so fast that he tripped and fell down. (2)
Soy más alto que mi esposa. / I'm taller than my wife. (3)
Ven aquí, que te voy a dar un abrazo. / Come here; I'm gonna give you a hug. (4)
lo que = what (headless relative clauses)
lo que quiero para Navidad / what I want for Christmas
lo que me enojó / what made me angry
For a full list of all 16 uses of "qué/que", visit the DRAE on the RAE's website.
And finally, as for why you can say "qué" as well as "lo que" in this case, as Carlos Alejo says in a comment above, I suppose it's just a characteristic particular to the mental verbs "entender" 'to understand' and "pensar en" 'to think of'.
Entiendo lo que escribió. Entiendo qué escribió. / I understand what she wrote.
Pienso en lo que nos depara el futuro. Pienso en qué nos depara el futuro. / I'm thinking of what the future holds for us.
"Qué" and "lo que" are in fact not usually interchangeable: (** means practically nobody says this)
Quiero lo que veo. **Quiero qué veo. / I want what I see.
Dame lo que quieras. **Dame qué quieras. / Give me what[ever] you want [to give me.]
quechange the meaning at all? Thanks!