They found a sort of loophole in the law. It's supposed to be self-regulating in a way, because being enormous means a lot of drivers and a lot of accidents so businesses get very picky about who is allowed to drive and how they drive. That falls apart when there's a bajillion drivers but they're made up of thousands of separate "delivery contractors" running fly-by-night businesses that the owners fully expect to die at some point and so don't leave any cash in and don't put improvements into.
E.g. I hear Walmart's trucking side is actually fairly nice and difficult to get into. They pay relatively well for the work and it's a cushier kind of trucking (more local, I think), which means everyone wants to work there and they have exacting standards for their drivers. They don't want insurance payouts.
Amazon seems notably different because it is _weirdly_ common to hear a story that goes something like "Amazon driver gets arrested for driving double the speed limit while high". The kind of thing that would trigger fleet-wide drug tests at most businesses, but is sort of a normal hum over at Amazon.