For most non-fiction authors, far and away the biggest monetary benefit of writing books is indirect, e.g. reputational benefits associated with being a published author on a topic. (Going with a recognized publisher can make more sense in this case.)
I did make a few thousand the one time I went with a publisher. I’ve also self-published and didn’t really try to make direct income at all as I had a free downloadable ebook. The only real cut I got was when third parties bought books for me to do book signings.
On the other hand I’m pretty sure I’ve made tens of thousands of dollars at least in indirect professional benefits.