Once upon a time humanity sent an unmanned probe into space and it was hit by a meteor. Unable to recall its mission, the Nomad — as it was named — continued out into space and met a similarly damaged probe from an alien species. They merged, healing each other and creating a new directive — exterminate.
On a whimsical note: Kirk’s temporarily adopted “son” — who was forced to commit suicide when there was totally a way to reprogram the dang thing — could have been a doctor. “Just think of it. My son, the doctor.”
Starfleet Academy Lecture Suggestion: This Is Why We Can’t Have Nice Things