[subject] + 到底 + [question]
到底 + [question word as subject] + [verb]
[subject] + 到底 + [verb phrase]
到底 in a question demands a straight answer – "on earth", "exactly", "so which is it?". It goes after the subject and before the verb. The speaker is impatient or confused.
When the question word itself is the subject, 到底 goes first.
到底 needs a real question: a question word, or the verb-不-verb form. It never goes with 吗.
In a statement, 到底 says something finally came about after a long wait or a lot of effort. It often comes with 还是.
到底是 + noun explains something by what it is: "after all, she is a child".