In the Marvel Comics universe, the first individual to go by Captain Marvel was Mar-Vell, a Kree agent who was sent by his superiors to spy on Earth and see if it posed any threat to the Kree Empire.
During the fight, a Kree Psyche-Magnetron device detonated, and that resulted in his DNA being fused with Carol’s, thus giving her powers.
Down the line, Mar-Vell met Carol Danvers, and Mar-Vell’s arch-nemesis, Yon-Rogg, kidnapped her to force Mar-Vell into battling him.
Eventually Mar-Vell joined the Avengers and turned his back on the Kree empire, but exposure to a nerve gas gave him cancer, and he soon died.