Did you buy tickets separately? If yes, you need go through immigration and customs. If you bought them from one carrier, but you have a connecting flight with another carrier from the same airport, you do not need go through customs.
Do I need a visa to transit through Australia?
You may need a Transit visa (subclass 771) if you plan to travel through Australia to another country.
If you are transiting though Australia for less than eight hours and you do not need to leave the airport transit lounge (except to board your connecting flight), you may not need to apply for a transit visa (subclass 771).
If you are going to stay in Australia for longer than 72 hours, you cannot get a transit visa, and you will need to apply for another type of visa.
If you belong to one of the categories and meet the criteria outlined below, you can transit through Australia without applying for a visa.