42 minutes is basically current commercial television timeslot time. I would guess several writers are trained to do the story within the 42 minutes (roughly 42 page screenplay if I remember correctly). While that's not needed for a streaming environment, I suppose they designed these episodes in a way...just in case they need to put it on TV, they won't have editing issues, like older shows that were designed for timeslots that has less commercials (Star Trek, in 1967 was I believe 50 minutes long, with 10 minutes of commercials. Star Trek: The Next Generation, and Deep Space Nine were 45 to 47 minutes long. Voyager started to go from 45 to 42, and Enterprise started to be reduced to 42 minutes. very early on, if I remember correctly.
Cartoons in a half hour timeslot were 22 minute shows for a while. I think it may be down to 20 minutes...maybe less. Some anime are designed for 22 minute time slots, but some episodes can go up to 27 minutes long. They can do this because late night anime in Japan is not technically commercial television. It is more like an infomercial for the anime itself, other anime, and related merchandise, since the merch is what gets the show back the costs...due to them having traditional commercial backing via sponsors advertising. This is also why direct from the source anime BD are really expensive (before their economy fell around 2014, it wasn't unheard of to have a BD with only four episodes on the disc that cost $100 USD). This is how shows make their money back.