As mentioned in the linked text and in @grfrazee's answer, the secret is influence lines. Or, more generically, influence surfaces.
For starters, let's stick to influence lines, since they are far easier to describe. An influence line is a diagram for a given point on an object composed of unidimensional beam elements. It describes the internal force that will occur on that point due to a unit load applied at different points along the entire structure.
For instance, a simply supported beam has the following bending-moment influence line for the point at a quarter-span (I'm mostly going to talk about bending moment influence lines here, but the general gist of things applies to other forces as well):
This means that if a concentrated unitary vertical load (say, 1 kN) were applied at that point, it would cause a bending moment at that point equal to 0.75 kNm (or 7.5 kNm if the load were 10 kN). If, on the other hand, the unit load were applied at midspan, the moment felt at the quarter-span would be equal to 0.50 kNm. And so on.
This also tells you that the worst-case scenario for this point is to have the entire structure loaded. This can be seen by the simple fact that all values on the influence line are positive, therefore a load applied at any point on this beam will increase the internal forces occurring at the quarter-span.
This, however, is an isostatic structure which can be trivially solved. Once you move into hyperstatic (statically indeterminate) structures, things get messy. For instance, take a look at this relatively simple hyperstatic beam:
This is a relatively simple structure, but it's already impossible to find a closed-form solution for the precise best location of loads. For non-trivial structures, influence lines are a pain.1 You can however notice one important thing: at the supports the value is null and shifts from positive on one side to negative on the other. This happens in every structure. If, instead of supports you had columns, then the value at the columns won't actually be equal to zero due to the deformability of the column. That being said, the result is usually very close to zero, so you can usually consider columns as perfectly rigid (i.e. as normal supports) with barely any loss of accuracy (assuming reasonable layouts).
So, if you're only dealing with distributed loads (such as in a building), this is the only rule you need to find your solution: if you're looking for the maximum positive (tension on the bottom fiber) bending moment, apply loads on the span in question, don't apply loads on the neighboring spans, apply on the ones neighboring those, etc. In this case, the actual values of the influence line are irrelevant, all that matters is the sign (positive or negative) at each span. Basically, here's the rule in graphic form:
However, what if you're building a bridge and you need to take into consideration the position of the load train, which is composed of concentrated loads? Complicating matters, the position of the load train usually has a lower (if any) distributed live load, which means there's an interaction between these two parts.
So, looking at the second figure, where would you put the load train? It is pretty intuitive that you want to place it near the maximum value (in this case 0.3704). But what if you have an even number of wheels or if your load train is asymmetric? Do you want to put the truck's load center at the maximum? Do you want to certify that the heaviest wheel is at the maximum? Is your uniform load so freakishly high that, actually, you're better off putting the truck far away where it won't reduce the result due to your uniform load?
Even worse, what if you're actually looking for your negative bending moment envelope? Then you know you want your truck at the neighboring span, where the influence line sign is negative, but once again, where do you put it? You'll need to derive the equation of that curve in order to find the point of the maximum value (its not at the middle of that span), and then you'll still have the same issues described above.
These are all possibilities which can't be reduced to a closed form solution for a generic structure. So you need to rely on software.
What most programs actually do is cheat. They approximate the solution by doing a moving-load analysis. First they use influence lines as described above to find out where to put the uniform loads. Then, for the load train itself, they simply place it at one spot, calculate the results, move it a certain distance (usually user-defined), calculate the new results, and repeat. It then gets the worst case and adopts that.
This method is obviously flawed because, if you use a step size equal to, say, one meter, you don't know if that maximum value found is the true maximum or if there was a certain point between the tested steps which would have given a higher result (there almost certainly is). So it's up to the user to define a step size such that the difference between the actual result and the one obtained is negligible (I usually use a step size at most equal to one tenth of the smallest span, preferably significantly smaller than that).2
This entire answer, however, has relied on influence lines. These are useful for linear structures such as simple beam systems and even some bridges. But if you have a truly three-dimensional structure, influence lines don't cut it and must be generalized to influence surfaces. These are no more than the three-dimensional version of influence lines. However, like all such things, influence surfaces are orders of magnitude harder to obtain. Every program I know which can calculate them brute-forces it: they apply a concentrated force at each node, one at a time, and see what happens.
That being said, as far as distributed loads go, the same approach suggested above (apply on one span, skip its neighbors, apply on the next ones, etc) can also be applied successfully for influence surfaces as well. In this case it becomes something of an approximation since the boundaries between slabs are usually just beams which are quite flexible for vertical displacements (relative to columns or actual supports). This means that, unlike the case for influence lines, where the influence line value at the supports is equal (or almost) to zero, the value at the slab supports (the beams) is not necessarily so. That being said, the error is usually reasonable (especially considering the low influence values for the slabs other than the one being studied).
That being said, it is quite common to simply assume for buildings (not bridges) that the worst case is with the entire structure under load, without considering influence lines. This is assumed knowing it is false and goes against safety (not loading neighboring slabs would result in a larger positive bending moment that that obtained by loading the entire structure), but it is equivalent to assuming that the value of the influence line on neighboring slabs is so small that it can be considered equal to zero. The validity of such an assumption is dependent on each structure's configuration.
As mentioned by @Arpi in the comments to this answer, it's also worth mentioning that this all assumes linear behavior. If your analysis is non-linear, then everything falls apart. Non-linearity breaks everything.
All figures here were created with Ftool, a free 2D frame analysis tool.
1 It's actually quite easy to determine influence lines yourself if you have an analysis software, even if it doesn't calculate them itself. For bending moments, place a hinge on the desired point and apply equal and opposite bending moments to each side of the hinge such that they create a unit rotation in the deformed configuration. That deformed configuration is your influence line. This same idea (the Müller Breslau Principle, which is based on the Maxwell-Betti reciprocal work theorem) can be applied to find the other forces' influence lines as well.
2 The Ftool software used to draw these figures actually uses a genetic algorithm to find the optimal load train position. It isn't analytical and is actually itself something of an approximation, but it is for all intents and purposes exactly correct. The article which developed this method can be found here if anyone's interested.