I am told that the aileron size has to be sufficient to counteract the rolling moment of an asymmetric flap failure and still leave sufficient control for a "reasonable rate of roll" towards the side of the failed flap. I am also told this is an arbitrary requirement, but that's how it's decided in theory.