Pre 1939, Britain was considered Australia's strongest ally. This was shown by the committment of Australian troops to WW1, and this showed the strong underlying colonial/exmpirical relationship between AUS and Britain.
With the onset of WWII, Britain was solely focused on defending itself from Germany. Japan was also attacking through southern asia (Singapore, PNG) around the same time. Australia requested assistance in the form of British Navy Ships to defend against possible Japanese attack, but Britain refused/declined as they needed their own ships to defend herself. Australia realised it could no longer rely on it's colonial master for protection, and AUS realised the US would be our best ally, so AUS strengthened it's relationship with the US. The US stationed troops and aircraft on the Australian mainland.
Basically Britain could no longer defend Australia, so Australia sought stronger relations with the US, to help defend against any possible Japanese attack. And ever since WW2, the US has been our strongest ally.