Pre WW2 we were basically in lockstep with the UK. However after Singapore fell to the Japanese it became increasingly obvious that the UK could not be relied upon to defend Australia. At the time most of the elite Australian troops were fighting in North Africa (El-Alamein, Tobruk etc). and there was a genuine perceived threat that Australia could be invaded. PNG which was Australian territory at the time was invaded. The Japanese bombing of Darwin only intensified this.
Almost overnight our foreign policy swung behind the US instead. Post WW2 this led to things like the ANZUS Treaty. It is the reason there are US military bases in Australia and the reason why we have followed the US into all of their wars which we arguably had no business involving ourselves in (Vietnam, Iraq etc.).
Personally I feel the recent actions of the US are not beneficial to Australia's interests at all. Trump has squandered an awful lot of accumulated goodwill already, even if another government is elected in US a lot of damage has already been done.