It isn't absolutely necessary but most sumps are designed to have less depth in each chamber as it goes from the inflow to the return. The inflow chamber is normally the highest and contains the primary mechanical filtration (socks, floss, rollers, etc.) the extra height reduces bubbling and noise. You usually want an odd number of chambers as you want the baffles to work in reversing fashion (usually under the first baffle, over the second, under the third, over the fourth, etc.) and it is best if the return chamber is feed by an over section, thus an odd number of chambers. If we choose a three chamber sump, it would normally go under the first baffle to the center section which is typically the skimmer and other paraphernalia. You usually want that chamber to have a fairly constant depth for the skimmer. Then it normally flows over a baffle into the return chamber. The height of that baffle determines the depth of the second chamber which keeps it fairly constant. The last chamber is the return which I prefer to have as small as possible relative to the return pump as I prefer frequent small ATO fills to large infrequent ATO fills.
My AIO is a five chamber so it goes through my primary mechanical media and heater (chamber 1) under the first baffle into the second chamber that contains my skimmer and uv, then over the second baffle (which in my sump is adjustable), into the third chamber which contains my refugium, then under the third baffle into the fourth chamber which is where my rear temp sensor and ATO fill is, then over the fourth (which is also adjustable) into the return section where the ATO sensor is also located.