>>29879129There are seven Trials, replacing the gyms. It's a mini-quest that ends with a fight against a Totem Pokémon, which starts with boosted stats, can call for help, and use actual strategies. After you clear all the trials on an island (1 on the first, 3 on the second, 2 on the third, and before you fight the trial on the fourth) you fight the islands Kahuna, which is more like a traditional gym fight.
After you clear all the trials, you are told that normally, you go fight all 4 Kahunas again in a Final Trial, but because Alola is starting anpokemon league, the E4 will be replacing that tradition. Once you clear the E4, you become the first ever champion of the region and have to defend your title as the post-game.