It's because "O que" means "what" and the other "que" means the relative pronouns "that". For example, "O que é QUE ele disse?" can be answer "Ele disse QUE ama você".
We can say "O que ele disse?" or "O que que ele disse?", hahaha. It's the same word, but it have different meaning. In English, I saw it in "I had had a dog when I was a child". I remember that I thought "Why two 'had'?". Hahaha. I hope that I have helped you! .