I know several folks who wrote chapters and whole textbooks. None of them are rich and several of them got exactly NOTHING for their hard work, other than salary that they earned for their full-time jobs. I guess it depends a great deal and I believe most of any profit goes to the publisher instead of any of the authors.