I believe the intent is that cars making a hook turn must wait for the signal to change before crossing, which de-conflicts their movement with the trams. With a normal right turn across tram tracks, drivers would have to do one of two things:
(Note that for the rather mediocre diagrams that follow, I've used an image of streetcar tracks in San Francisco, courtesy Ken Lund, as I wasn't able to find a suitably licensed picture of Melbourne that works for this purpose. Accordingly, the cars drive on the right and the turns in question are left turns. If you're in Melbourne, everything in the Northern Hemisphere is upside-down to you anyway, so this will make perfect sense.)
Turn across the tram tracks. This is unsafe and unnatural, as trams going straight may be passing on the right, and it is difficult to check both in front of you (for oncoming traffic) and behind you (for trams). One must be sure it is safe both to cross the tram tracks and proceed across oncoming traffic before turning, and it's just not possible to see all the ways in which you could cause a collision at once. And the consequences of an accident, a tram ramming the side of a vehicle at speed, are fairly severe.
In the diagram below, the blue car wishes to make a left turn (left turns are actually prohibited at this intersection, though I can confirm this does not stop many drivers from going for it anyway). He stays off the tram tracks and turns across them, following the red line. He is hit on the side by a streetcar proceeding straight through the intersection (green line).
Merge onto the tram tracks and wait for a gap in oncoming traffic. This would greatly delay the trams, defeating the point of (often ignored) dedicated lanes to speed the movements of trams.
In the diagram below, the blue car wishes to make a left turn. He drives on the tram tracks, enters the intersection, and stops until there is a suitable gap in oncoming traffic (which may take the entire traffic light cycle). An entire tram full of people, represented by the green line, is delayed while a single car waits to turn.
Hook turns provide another solution: get right-turning drivers out of the way of trams and have them wait until the next signal phase before proceeding. This allows trams to continue straight without delay and avoids the risk of right-turning drivers colliding with trams.
Here, the blue car moves all the way to the right and gets out of the way. He must wait until the traffic light changes before proceeding; he can only complete the hook turn after the light changes. There is no danger of a collision with the green tram, as it will have a red light before the blue car proceeds with his turn. This video of a Melbourne bus performing a hook turn is also instructive.
According to the paper, "Managing Trams and Traffic at Intersections with Hook Turns"1 (well, the abstract, which is all I've got at the moment anyway), hook turns in Melbourne reduce tram delays, saving a great deal of time and the transit authority millions in costs, while offering "better safety performance than conventional intersections." It also helps that 38% of drivers avoid making hook turns, which is basically the "we'll make something annoying enough that maybe a bunch of you just won't do it" school of traffic engineering. In short, it's about both safety and efficiency.
In other areas with on-street trams and no hook turns, it's not uncommon for turns across the tram tracks (right turns in countries where you drive on the left side, left turns in countries where you drive on the right side) to be prohibited entirely or only allowed during a left turn arrow signal phase, which further slows down traffic as all other vehicles must wait while the left turns take place.
1: Currie, G., & Reynolds, J. (2011, December). Managing Trams and Traffic at Intersections with Hook Turns. Transportation Research Record: Journal of the Transportation Research Board. Transportation Research Board. https://doi.org/10.3141/2219-02