This is a great question, a great film and classic puzzle for most sci-fi films that challenge the human condition.
You Have To Understand Zac
Zac commits suicide at the start of the film because he feels very depressed from his involvement in project Flashlight. He fears that the experiment will have dire consequences and he can't live with that guilt. He suffers from a social detached personality, is divorced and has a problem getting along with other people.
This is important, because Zac finds himself in a world where he thinks he's the only man alive. What starts out to be the ideal world for him to live in turns into an endless hell as he discovers that he hates being alone and starts to go crazy.
He changes into a person who needs to be with someone and this is when he finds Joanne, falls in love and has a chance at happiness.
Api shows up and Zac realizes he hasn't really changed. People find him difficult to get along with.
What Is The Effect?
Project Flashlight was an experiment to create a grid around the Earth that would wirelessly power military devices. The experiment was computer controlled, and Zac is almost certain that Flashlight is the cause of The Event. He discovers that the grid is still on and that another event is going to occur. Except this time it will be bigger.
There was an unexplained connection with the Sun. Something they didn't expect and the grid interacted with the Sun to cause the effect.
Prelude To The Ending
Zac comes to realize that everything related to The Event is his fault. His difficulty getting along with people, his feelings of guilt for his involvement and a life of feeling depressed. His act of destroying the research center is an attempt to atone for what he has done.
So we have a person who hates being with people, is the engineer who works on project Flashlight, who kills himself at the exact moment The Event happens, then he wakes up to find himself alone. I don't think this is a coincidence. If you can accept that Zac and The Event are somehow connected, then the ending makes more sense.
Ending Break Down
Zac drives the truck full of explosives to the research center, but before he can enter the compound the truck collapses into the ground and falls into the control room. This is the only indication in the end that something went wrong. Had the truck not gotten stuck he would have been able to drive into the compound and destroy the dish before The Second Event happens.
Just before the truck falls in, Zac closes his eyes and says "f#ck!". He knows he didn't make it.

Joanne and Api cry out "It's started!" as the effects of the event begin to be felt, and then Zac presses the button to trigger the bomb.

It's too late! The Second Event triggers and we see a quick flash of the sun. Followed by the explosion triggered by Zac. In that order. Had the explosion stopped the event the sun would not have flashed.

Joanne and Api are now gone (or are they? see at bottom)! Just like the first event. All life on Earth disappears, and just like the first event Zac has killed himself. He has committed suicide. We know he is dead because we watch the research building go up in the explosion, but we don't see what happens to Joanne and Api. That part is left ambiguous, but I'll try to explain why lower down.
The next thing we see is the "tunnel of light", and then Zac wakes up on another planet.

The very last thing we see of Zac (during the credits) is his face while he quickly looks at the readout of the device he uses to measure the event, and then he looks out to the sky in horror and awe as he realizes he is no longer on Earth.

Explaining The Ending
To understand the ending. You have to understand the beginning. This is critical to the entire film.
Zac has always been dead.
The film was made in New Zealand, and filmed in the city of Auckland. The largest population of Catholics is located in the city of Auckland. The book and director of the film make several references to Catholicism.
Catholics believe that if you commit suicide you go to hell.
Zac commits suicide at the start of the film, and wakes in a world that is perfect for him. He hates people and there aren't any. What should be heaven turns slowly into hell as he realizes he needs people to survive.
Joanne is introduced, he falls in love but loses her to Api.
Zac commits suicide a second time, and wakes up on another planet. He realizes in horror that he has not died (again), but this time there is nothing. There are no cities, there are no houses to ransack, there will be no women to keep him company and there will be no men to talk with. His hell has gotten worse.
Zac is living his afterlife in Hell, and each time he commits suicide his Hell gets worse. It's a sci-fi abstract take on the Catholic values of suicide and afterlife.
About Joanne and Api
I've always taken Joanne and Api to represent Adam and Eve in paradise. Zac represents the evil in paradise, and when the second event happens evil is expelled from paradise.
Depending on which perspective you take. It's up to the viewer to decide their fate. If the two represent Adam and Eve, then they survived the second event to repopulate the Earth. If you are non-religious then they disappeared like all life did in the first event.
All the survivors in the film were people whose death was a sin. I would say that Joanne and Api were real people, but we can assume they too were in the afterlife.
The question of "what is the afterlife" in the context of the film is never explained. It's simply shown that it's relative to the characters.