The final battle of a game is a battle in which the player needs to win in order to enter the Hall of Fame and see the credits. Typically, the final battle is against the Champion.
The final battle in the core series games is required to beat the game. Winning the final battle lets the player enter the Hall of Fame. The final battle has the highest-leveled Pokémon in the main story.