Magic potions are used to speed up your buildings / researches / missions, extend the building lists, restock your resources, annex villages, temporarily boost your resource production and recall your troops. You can buy magic potions in the shop, use the "Earn magic potions" function or watch videos.