In a software like keepassx, to generate passwords, there's usually the option to tick some boxes. For instance, a box that makes sure that at least 1 character from every lists of characters has been chosen. Where the lists of chars can be lower cases, upper cases, digits, special chars, etc.
I understand that a purely randomly generated password can produce passwords like "aaaaaaaaaaaaaaa" which aren't secure. But in average, I don't understand why making sure that there's at least 1 char from every lists is more secure than a purely randomly generated password.
How come it's possible to "beat" (in terms of security) a purely randomly generated password? Shouldn't these kind of passwords contain the most entropy in average, rather than a password made with human intervention?
Edit: If I have to assume I must protect against a cracker, I assume he uses all possible kinds of attacks. Brute force, dictionary, etc.
Edit 2: I've been thinking on it during the night. I noticed that if the password is very large (say length > 25) then the difference between ticking the box to make sure that there's at least 1 char from each group and not ticking the box is almost nil. Because the probability that there's no char from each group is very low. The other extreme case is when the password is very small, say of length 4. The case is more complex and I'm not sure which is more secure against all possible kinds of attacks.