Yeah Mar-Vell was a Kree in the books who was known as Captain Marvel. Carol Danvers was a non powered character who they gave powers to later in the 70s when there was a big push for more female super heroes in comics. A lot of these heroes were just female versions of male heroes (spider woman, she hulk, etc) so she became Ms. Marvel.
Fast forward through a strange God rape storyline, alcoholism and losing her powers in the 90s edgy era, gaining her powers back and becoming the OP Binary for a while, then a good run of Ms. Marvel comics in the 2000s.
Mar-Vell dies and Carol takes on the name of Captain Marvel in an absolutely fantastic comic series written by Kelly Sue DeConnick. Annette Benning's character in the movie sorta plays a merged version of Mar-Vell, Tracy Burke, and another character (who's name I can't remember) who was a pilot who's records she wanted to break before she got her powers.
The movie took a lot from Kelly's comic books. They are well worth the read. First one is called Captain Marvel: In Pursuit of Flight