The finals for the AFL are based on the top 8 teams in the ladder. The ladder ranking system is determined by winning points and percentage margins by each team over the entire season. It has been used since 2000 to have a fair system of ranking each team.
The top for teams on the ladder only need to win two finals to make it to the grand final, whereas the bottom four teams in the top 8 participate in a four-week tournament. The grand final is played in the fourth week of this tournament between the two remaining teams.
Basically, the top 8 teams are split into two groups for the finals series. The winners of the top four teams get a bye to rest before playing the preliminary finals. The bottom four teams play two elimination finals where the winners advance to play again in the second week.
The top two teams in the ladder get to host their finals matches, giving them the home ground advantage. The seventh and eighth teams play away games in all their finals and must win all three of their finals matches to avoid being eliminated. This is when the real underdogs get their victory, as the Western Bulldogs did in 2016.