Quoted By:
Probably some type of mystical nature to it. For instance, if we were to classify things based on appearance, we'd have tons of Pokemon being wrongly typed, Flabebe is a good example. So clearly there is either something mystical about it, or they're classified entirely based on weakness/resistances/immunities, which for things like Color Change are more DNA altering than anything, which could be a darwinian evolution thing based on Mew's ability to transform for instance, where it's retained a variant of it essentially, but only in regards to typing, and it uses it as a self defense mechanism to protect itself, but there are limits when it comes to dual typing.
Now there are issues here however when Pokemon are reclassified. For instance how was Steel, Dark, and Fairy recently discovered if these classifications were already done? Did nobody try to burn a Magnemite before? Why wasn't it working prior to discovery? It'd be one thing if it was always weak to fire and it was just later classified by finding other species and understanding it and giving a name to it, but that's not the case. Multiverse can only be explained so far. Largely I think some things don't really exist lorewise like color change or magnemite not being weak to fire, and it's just a gameplay mechanic rather than a lore thing.