Some people just have a natural affinity for an element, it seems. Like the Wayfinder trio with Earth, Water and Earth, both Lea and Isa had shown affinity for the Sun and Moon as humans. I assume what happens is that when they become Nobodies their bodies automatically have a higher affinity for magic thanks to their connnection to the Realm of Darkness and thus they naturally manifest those powers. Naminé is a special nobody with power over Memories originating from the bond between Sora and Kairi, and in KH lore Memories are heavily associated with the Heart, something both of them have power over (Sora with his latent Power of Awakening, Kairi as a PoH).