In some ways the cases are standardized around being a quarter, third or half the width of a semi trailer inside width in some dimensions. So once its in a case its usually okay.
Typically the cases are packed in layers based on depth and with, so if you have a set of thirds cases, they will go in a layer, if you have a cases with some odd depth, they will tend to go together. The weight of things is taken into account as well, heavy stuff tends to get packed towards the sides, near load bars (metal bars that keep the load from shifting) or the front sometimes. There are sometimes considerations for how it gets from the truck to the ground, because sometimes you get somewhere and theres no dock, or your in a smaller truck with a gate. So forklifing things is common.
What goes into each case is a complicated subject. Some cases are just full of all cables of some type, or full of lights or speakers. Sometimes a case will be built around being a kit for something, or around "this is everything that goes to Greenroom x". And you have an assortment of special cases, TVs, stuff like that.
You also sometimes have to consider who opens and sets up whats in a case, so rigging gear will need to be kept separate from audio gear, since those may be setup by different teams or different unions, even if that gear goes together when the show is setup.
Odd sized cases and loose stuff is often packed on top or "rides on top" of larger roadcases in the truck. Often this stuff is moved from the truck onto cases before its moved into the building, since pushing a case with some extras on top is not as hard as carrying the stuff all the way in. Sometimes carts are used, not as often as I would have hoped.
In many venues the people who move the cases from the show area (arena floor, stage, etc) are a separate team or separate union. If you start out in IATSE, the stagehands union in the US and Canada, you will often start by pushing boxes and generally doing physical work.
But at the end of the day the truck is loaded by weight, so theres often tons of volume left over when the truck is "full" as its now at its max weight.
Before a tour is initiated, experienced tour managers and roadies will work out plans and schedules for all theses things. My first gig as a stage hand was working a Destiny’s Child concert. The way I got the job is I was at a concert the weekend before, saw the stage hands and roadies working and though “that seems fun” so he next day I called the event company that managed it all. They gave me the number for the manager of all major events, who said I could come in the following day. I figured for an interview, but he meant to work. I signed some papers, got a 30 min or so rundown of what I was going to do and who was to be my primary contact for assistance, and then I was given a schedule and detailed instructions. I had absolutely no idea what I was doing walking into it, but at the end of the night as we were tearing everything down and packing it up for the next stop on the tour, I realized not once had I stopped to wonder what the hell I was supposed to do. It was the most well oiled operation I’ve ever seen, and his goes for all the major events I worked – particularly the American shows were stringent beyond belief. There was never a doubt as to what had to be done, and when. Roles were clear, assignments were handed out and schematics of everything were available. Everything was marked with colors, letters, and numbers and there was a legend you had to memorize before things came in. There was always a system so you could tell what part goes into which box and into which truck and in what order. All of this was prepared long before a tour started, nothing happened Just In Time, it’s pretty much all AOT. (Except for a few artist rider requirements, like Ozzy Osborne requiring something like 20 bars of moisturizing hand soap.)
I’d say if there’s a program to be written that compiles these packing manifests, schedules, and instructions, it’s a constraints solver. It’s all prepared ahead of time, and honestly most of the job anyway is figuring out all those constraints in the first place. The actual compilation isn’t that tricky, it mostly comes down to experience and a bit of trial and error – i.e. is this thing gonna fit there if we also put that there, and will they move when on a bumpy road or on a flight?
I honestly think it’s one of those few jobs that aren’t really helped much by technology, but mostly by experience. I mostly worked shows that had already been planned, but did a few sessions with managers that tried to work out how to pack the show. Those were mostly a waiting game to see what the current plan was, test it and then evaluate. Testing meant packing up a show, and then unpacking and building it back up. It was timed, and we noted things that were trickier than they had to be. If there ever was an issue where you thought “they’ll figure it out on the road” or “it’s someone else’s problem” you knew to flag it, and then they had to reconsider and they did. I have heard horror stories of bad managers, but I always worked with good ones that took the time to listen and care to fix things. In the end, a minute aged is a minute earned, and venues and workers are expensive so tours really wants things to be as efficient as possible.