I realize you can just answer, “mysterious aliens beyond our understanding,” but why would a space probe have a mandate of either talk to a whale for 30 seconds or destroy Earth and disable everything in its path on the way to Earth?
Why? What does that achieve?
In Star Trek, some cetaceans are sentient. They may have had first contact with others long before humans and forged some kind of relationship with the alien entity(s). The probe was coming to either check up and make sure their friends still exist, or avenge their extinction (I’m sure if they were in touch, they were telling them all about the atrocities we were inflicting on their species.). It came ready to wipe us out, and contact with an actual whale changed its mind. The whales may have told it to back down as well, after they had their mind meld conversations with Spock and decided to help when he may have told them that humans of the future had completely changed their ways.