XP is primarily earned by merging items and by other sources.


When you run out of items on your base to merge, you will need to go into Dungeons to earn chests and crates. These contain items and can be merged which will grant you XP.