How it works:
Think of a red or green "wire" as actually a big bundle of strands, one for each item plus a few extras. The "voltage" on each strand is the sum of all items that the wire can "see" in objects or combinators that are connected to the same wire.
All 48 chests are connected together with red wire: so the "green circuit" voltage is the total of all the green circuits in all the chests. This wire is also connected to the input of the arithmetic combinator which is set to divide the "green circuit" value by minus 48 and output the result as a "green circuit" value: The output is therefore the average amount in each chest, as a negative number. (If you have a different number of chests, then divide by the number of chests you are using). The combinator output is connected to all the inserters which feed into the chests with another red wire. This red wire must not connect to the red wire connecting the chests!
Finally, each inserter is connected to its own chest via a separate green wire. (There should not be any green wire connecting the chests, only red wire).
The red wire supplies each inserter with the average chest contents as a negative number, the green wire supplies the inserter with its chest contents as a positive number. So the total at the inserter will be positive when the chest has more than the average number of items, and negative when the chest has less than the average number of items.
So the condition on each inserter is "green circuits less then or equal to zero": Each inserter then fills its chest whenever the chest has less than or equal to the average number of items of all the chests. So regardless of the initial state, or how the chests are emptied, all the chests end up with an average number of items: this average will steadily increase.
Usually, about half the chests will be less than or equal to the average, so about half the inserters are operating as the chests fill up.
For the supply belts, you just need one belt for each belt full of items you are producing, and at least as many chains of priority splitters as you have belts: extra splitters will help to re-balance the chests if the train comes in with unbalanced cargo wagons.
Here is the blueprint:
blueprint