Look...
In G/S/C, they added genders while still keeping compatibility with the older games. This meant they couldn't add a new value to base the gender on as Pokémon that originated in R/B/Y would have no such vaule, and thus had to base it on a value that was already there. Therefore, genders were determined by the Attack IV. The higher values meant male, the lower values meant female. The other stats, however, could be much higher in the female, or they could be lower.
This meant that a R/B/Y/G/S/C Pokémon would simply be male if it had higher Attack and female if it had lower Attack.
As of R/S, however, they ditched the compatibility with the older games and added a bunch of more values, which includes the number that determines genders.
So yeah.