I've noticed that too, and the decision seems to be more about fashion than usability to me. I noticed that it tended to happen as MacOS became popular; not as the design was better or the use-cases changed.
This MacOS dock has been around for a long time. It was actually copied from NextSTEP, which was cloned in WindowMaker, which was one of the most popular window managers for unix in the early 2000s.
But even then, the most "mainstream" window managers were copying Windows, which was the most popular OS of the day. Free Software developers would aspire to create something mainstream, and would look to copy whatever was mainstream. Back then it was windows. Today it's MacOS.