With pens and corrals, the animals can be moved naturally from one point to another, following the one ahead of them. There are specific ways to design facilities to move animals through slaughterhouses naturally.
In some places they're still being used though.
Temple Grandin is the woman who got her PhD related to animal husbandry despite having autism then designed the humane method of leading cows to slaughter …her method is required in California but not all states are required to use it. Google the movie “Temple Grandin” it’s a cool movie