In Pokemon Legends: Z-A, you'll collect plenty of Mega Shards before understanding their purpose.
The game introduces you to the story and mechanics, including Wild Zones and Battle Zones, through a tutorial-like early game.
Mega Crystals, which contain Mega Energy, can be shattered to obtain Mega Shards, but their use is not immediately clear.
Mega Crystals are clusters of rock-like formations and pink shards, described as collections of Mega Energy.
Author's summary: Mega Shards in Pokemon Legends: Z-A have a unique purpose.