On a typical design, someone early on will decide that, say, an 84 pin connector will be used. There's 16 address lines, 16 data lines, four control lines and four power supplies. To handle the current each supply rail will use four pins, so that's 16 needed for the supplies. This gives a total in this example of 52 lines needed, leaving 32 spare. The supply lines will often be put on the same pins for a number of cards that could go on the same motherboard to prevent damage so the fixes their position. Another card may need a fifth supply, so that could mean four pins are left spare for that. So now we have 28 pins spare. We'll want a ground line between each data line to help shield it, so that takes 17 of our 28, leaving 11 lines that we can use for ground. Sometimes these are placed with care and consideration at the start of the design. That's usually the way, however it is very normal for the design to be tweaked a little, another couple of control lines are needed after prototype boards are made and they end up using the most convenient pins just to simplify the board relayout.
Thus what should have been, and indeed started out as, a sensible spacing of ground lines often ends up being a mess.