The goal of the game is to destroy the opponent's shrine, just like you would destroy another unit (reduce it to 0 HP or lower). Note that shrines have "Shrine Resistance", which reduces damage from units by 30% and damage from spells by 50%.
If a player is using an Avatar instead, the Avatar acts like a Shrine while it's immobile. It loses Shrine Resistance once it Transfigures into a champion. It is also solution to make Avatar from your own shrine after you killed all enemy units, how you could destroy enemy impregnable shrine.