The primary goal for players in any main series Pokemon game is beating all the gym leaders on the way to becoming the champion of that region. All of these gym leaders are meant to be a serious challenge at that point in the run, and players normally can't progress onto the next part of their journey until they have beaten the necessary gym leader.