Threading text frames link multiple text frames, so the text flows from box to box. In the case of multiple-page documents, especially long books, changing the order of pages can become complicated. A helpful trick in InDesign is to turn on Show Text Threads so that you can see how your text boxes are connected page-to-page.
How to show text threading in Adobe InDesign
To see the connections go to View > Extras > Show Text Threads
If your pages are out of order (likely because of requested client edits and rearranging), you may consider dragging and dropping the pages into the correct order in your Pages Panel.
Alternatively, you can grab the text boxes on each page and drag them to the correct pages. The threading guides will help you see how the order needs to be rearranged to be correct and will help you confirm when you have the order correct.