Work for Hire.
You're hired to do a job for, say, a textbook company. You complete the work. They like it, accept it, and pay you.
You go about your merry way with your lovely payment.
The textbook company can sell it three ways to Sunday and make millions off of what you just did.
And that's because they own it. They're technically the author.
I wrote for several companies and was paid well. But I am not entitled to any kind of profits from the ginormous textbook companies because I was hired and paid to write that particular publication or book or supplement, usually as a consultant or freelance writer.
I have seen my work in schools, and though I can say I wrote it, I can't say I'm the author. The publishing company is the author.
That's just how work-for-hire works.

This happens in music too:
Pop singer Barry Manilow, who has been nominated fifteen times for a Grammy, winning once (only once?!?), started his musical career as a jingle writer.
And you know the jingles:
Like a Good Neighbor, State Farm is There
I'm Stuck on Band-Aid Brand 'Cuz Band-Aid's Stuck on Me
Come on, Come On, Come On...Get a Bucket of Chicken...Finger lickin' good
Give Your Face Something to Smile About...Stridex
All of these companies are giants in their industries, but Mr. Manilow is not entitled to any of those profits.
He was work-for-hire.
He wrote the songs (!), they accepted them, he got paid, they were free to use them as they wish, and a couple of those companies have continued to use his melodies for 30+ years.
Work for hire.
This is something to carefully consider when signing such contracts.