When GameFreak released Pokemon Ruby and Sapphire, they introduced a new Pokemon called Azurill. Azurill is the baby Pokemon of Marill. Azurill is a Normal/Fairy type (though originally introduced as just a normal type) that evolves into the Water/Fairy type Marill, who then evolves into the Water/Fairy type Azumarill. Marill has been an icon of Pokemon ever since it was introduced because it was originally suspected to be a water Pikachu.
Azurill looks like this:
and Marill looks like this:
When Marill first was introduced in Gold and Silver, it and it’s evolved form Azumarill had a gender ratio of 50/50, meaning that there was a 50/50 chance of encountering or breeding a male or female Marill or Azumarill. However, Azurill was created with a gender ratio of 25/75, meaning it had a 25% chance of being male and 75% chance of being female. This caused an interesting phenomenon to occur: 25% of all Azurills evolved from a female Azurill into a male Marill.
How exactly does this happen? Well, each Pokemon has it’s own personality value that determine its stats (applied to the Pokemon’s species), its ability, its gender, and many other factors as well. The last 8 digits of the binary coding for this personality value are used to determine the Pokemon’s gender. When these digits are put into a certain gender equation, they will come out with a number between 0 and 255. Each Pokemon species has a gender threshold number (based on it’s gender ratio), and if a Pokemon’s value is greater than or equal to the threshold number, it will be male, while if the number is less than the threshold number, it will be female.
Here is a diagram showing the gender thresholds in comparison to their gender ratios.
To use Eevee as an example, the species has a gender ratio of 87.5% (chance of a male)/12.5% (chance of a female). So if an Eevee has a gender threshold of 31 or above it will be male, and if it has a threshold of less than 31 it will be female.
So why does the Azurill/Marill gender transition happen? Well, if an Azurill has a gender threshold of less than 191, then it will be female. However, if a Marill has a gender threshold of equal to or greater than 127 then it will be male. So if an Azurill has a gender threshold of between 127 and 191, then upon evolution, it will transition from a female Azurill into a male Marill.
It has never really been exactly clear what the reason behind this is. It may just be a goof made by the Pokemon Company that they neglected to change, but on the other hand, it may be some kind of statement that the Pokemon Company is trying to make about gender. However, it is more likely meant to represent aquatic animals that also make these kind of transitions (clownfish, for example, are known to transition from males into females when one of their females die).
No matter what the reason behind it really is, the fact that there is this kind of gender transition in Pokemon can cause many players of all ages to think about gender in a way that is more outside of the box. Imagine being a young child and catching an Azurill in your Pokemon game. The Azurill is a girl, so you name her Molly. However, when she evolves into a Marill, suddenly she becomes a boy! Seeing that Molly is a now boy, you take him to the Name Rater and change his name to Merrick. Subconsciously, this can create an association between gender and inconsistency, or gender and change.
Some people treat gender as something unwavering and restrictive; and for some people this is the case. However, Marill can be representative of the fluidity of gender and the people that don’t feel like they identify as their gender assigned at birth. As such, Marill is an excellent form of representation for the trans* Pokemon community.
(note: this only happened until Generation VI, where Pokemon’s information is now preserved through evolution and migration [this wasn’t meant to “fix” the gender change, it was meant to fix a different issue with abilities changing through evolution after migration]).