From Bulbapedia, the community-driven Pokémon encyclopedia.
The Sun Shard and Moon Shard are special key items present in Pokémon XD. Their only use is to evolve Eevee into Espeon or Umbreon, respectively, as the usual necessary evolution method was not possible to achieve in XD.
In Gateon Port's Machine Parts Shop, a man will give the player a choice between five items; the Fire Stone, the Water Stone, the Thunderstone, the Sun Shard, and the Moon Shard. This is essentially where the player decides what they will evolve their Eevee into.
The Sun Shard and Moon Shard work simply by being present in the player's bag when the player's Eevee levels up. Upon this happening, Eevee will evolve after the battle (if a Rare Candy was used, Eevee will evolve immediately), into Espeon (if the Sun Shard was chosen) or Umbreon (if the Moon Shard was chosen).
These items were included in XD due to Eevee's (then) unique method of evolution: leveling up when at a sufficient friendship level at a specific time of day. While Eevee can become an Espeon or Umbreon in other games through use of the realtime clock, this was not possible in XD. This game, like Pokémon Colosseum, was not programmed to use the GameCube's clock , meaning that time-based events cannot occur in this game. As the developers wanted players to have Espeon and Umbreon available as choices at the same time as the other Eeveelutions, these items were made available to the player as a choice at the same time as the Fire Stone, Water Stone, and Thunderstone, which allow the player to evolve Eevee into its Generation I evolutions.
- A cheating device can be used to obtain Sun Shards and Moon Shards in any Generation III game. Since the item is not programmed into any of the Generation III games, however, it shows up as a ??????????, and will not evolve Eevee. However, those games don't recognize them as key items, allowing them to be held by Pokémon and traded to XD, where the item can be removed and used as normal.
- Though Pokémon Colosseum has the same lack of connection with the GameCube's clock as XD, the Sun and Moon Shards do not exist in that game. This is likely due to the fact that the player starts the game with an already evolved pair of Espeon and Umbreon, as well as Eevee's complete absence from said game.