It should appear before HS. After that and it is too late. Yo start good habits young. Given what they teach, or should I say don’t teach in grade school, perhaps it isn’t necessary. I had my homeschooler doing algebra at 7. Homework was necessary.
I never had homework really until college. Sometimes I would have a little math or a book report, but that was it.
I got an engineering degree in college without the homework of earlier years.
By college, I was making a choice and did what I had to do.