I've written biology and nursing textbooks for textbook publishers and textbook packagers. The way it has worked for me is that someone at the publishing company puts together a list of standards (state standards for junior high and high school texts, more general standards for college texts). Next, one or (usually) more experts in the field develop an outline for each chapter. Using the outline for one chapter, a writer and graphic artist put together a chapter based on the outline. This is often an in-house effort. This chapter goes out for review to people teaching in the field and they comment on its readability, accessibility, content level, etc. and make suggestions. The suggestions get incorporated and the chapter gets fine tuned.
Using the chapter as a sample, the publisher/packager hires writers, usually people with an advanced degree in the field, to write additional chapters working from the experts' outlines and using the sample chapter as a guide to reading level, text chunking, etc. The requirements are usually quite specific and do not allow for a lot of deviations. This writing is then edited by an in-house editor who usually, but not always, has a degree in the content field. This editor is supervised by a higher level editor who is often an expert in the area (science, math, economics, etc) often holding the highest degree granted in their area of expertise. Photos and graphics are added or at least their content is indicated at this point.
Once the in-house people are finished making the ms conform to the standards and guidelines they have developed for the book, it goes out to one or more experts (usually professors, physicians, etc.) who review the content and approve it or make corrections and suggestions. This can take several rounds of back-and-forth discussions. When the approved ms retuns to the publisher, the publisher does all the ordinary publisher type things like more house editing, then copyediting, proofreading, indexing. Somewhere along the line, the publisher also may hire a writer to do a teacher's manual and often to do end of chapter review questions. Sometimes a writer is hired to do textbook features if there are enough of them. These are the one or two-page spreads that are usually enclosed in boxes and amplify the text (think big sidebars). My first textbook job was doing textbook features.
So far as I know, fact checking takes place all along the way, with in-house editors questioning some facts and the experts reviewing others, but there is no specific fact checker the way there is for non-fiction books and magazine articles. If there is, I'm pretty sure it is an in-house job and is probably rolled into another job title.
My contract always says something about the content being based on verifiable research, meaning that as a writer I might get something wrong, or the interpretation of data might change or be a little off, but I made a good faith effort to get it right based on the current research and thinking in the field. Many others also review for content throughout the evolution of the ms. Textbook writing is a long, complicated process. Even college professors who write their own textbooks go through quite a lot of reviews and edits and generally get help with the writing and graphics.
I've worked for a couple of different publishers. Each organization has its own little quirks and differences, but the overall pattern is pretty much the same. Your best chance of working on a textbook is if you have at least a master's degree. People with advanced science and math degrees who can write to specification and on deadline are in demand and the freelance pay is good.