I think it's a combination of things. Some of it is envy—she's wealthy, has a close-knit family, a stable marriage, three beautiful children, and a prominent public role.
I also think a lot of the hostility comes from supporters of a certain couple who can't stand that Catherine has flourished within the Royal Family while Meghan publicly said she struggled there, and Harry described her as repeatedly crying on the floor. To those supporters, Catherine's success undermines the narrative that it was impossible to thrive in that environment. That's why some seem determined to portray her negatively, regardless of what she does.
Then you also have anti-monarchists who criticize everything the Royal Family does. They could cure every disease in the world, and some people would still find fault with it.