To add to Margo's explanation.
Australian Football is a derivative of Gaelic Football (indeed there is a hybrid game that Ireland and Australia play internationals against each other in) and was first introduced to keep cricketers fit in winter - which is why it's played on cricket ovals. It is the most popular sport inVictoria, South Australia, Tasmania and Western Australia, and also big with indigenous communities in the Northern Territory. It suffers in that there really isn't any real occasion to play international tests.
Rugby Union (which calls itself the game they play in heaven) is popular in NSW and Queensland and was the 'amateur' game (like the Olympics used to be - in fact Australia are the raining Olympic Champions, having won the gold the last time it was played in the Olympics in 1908. Teams partake in the Super14 league (which involves provincial teams from Australia, New Zealand and South Africa) in Australia there are teams from NSW, QLD, ACT, WA and there will be a new team from Victoria soon when the Super14 becomes the Super16. The Victoria team just sacked it's CEO because he was the architect of the Melbourne Storm rort.
Rugby League was born as the 'professional' Rugby at the start of the 20th Century - it is born of the class war in Northern England. Because it was amateur there was no money payed, however if you were working class and injured you had no means of support, unlike the upper classes, so a breakaway game was established where players could be compensated for their efforts.
In the hundred years since the game is very different from Union in rules and emphasis, but the actual skills to play are still similar and players do switch between the codes. It is common for boys to play Union at school and League in weekend leagues.
Union suffers from rules that make tries (touchdowns if you will) not significantly more valuable than penalty goals, so it is not rare to see a match where the goal kickers are the only scorers, particularly as the arcane rules particularly around ruck, maul and scrum make play a stop start affair at times. As I've quoted a few times Union tragics know in their hearts that as one of their kickers lines up a penalty goal, somewhere in the world a rugby league try is being scored.
What Union does have that League doesn't is that it is played to high level in a lot more countries, so international competition has meaning. In fact the Rugby Union World Cup is the second biggest single sport event in the world after the Football (soccer) World Cup. League is only played at the highest level by three countries (Aust, NZ and UK), and their world cup is usually a case of seeing whether NZ or UK will play Australia in the final (and generally lose - all but once in the last 30+ years).
If you were raised on American football I think a good game of NRL rugby league would be a revelation, because it just doesn't stop, the teams throw themselves at each other for 80 minutes with precious few stoppages and little protection. It's a mix of attrition, tactics, individual brilliance and brute force. Not to say an NFL game doesn't have that, it just has a lot of breaks between the action.
The current National Rugby League is a bastard compromise between the Australian Rugby League (the sports governing body) and News Limited which set up it's own 'Super League' in competition with the old NSWRL competition (which evolved from the elite Sydney comp which played its first season in 1907, and had developed into the most watched of the state leagues and unlike the QRL had teams from interstate (Canberra, Brisbane, Gold Coast, Townsville).
Football (nee Soccer) has the A-League, a nation wide competition with members of all the mainland state capitals and a few regional centres. It is part of the Asian Confederation. It is the most played team sport among kids. But doesn't yet have the pulling power of League or AFL (or Super14 Union). But unlike the other codes there is no sense that it is the game that 'those other states play'. It is truly the world game. Though dominated by Europeans and South Americans, there are still moments of glory in the World Cup for the North Americans, Africans and Asians.