So when Fawcett stopped publishing Captain Marvel comics, in part due to a copyright infringement suit from DC (DC said he was a copy of Superman), Marvel came along and used the name for its own Kree Captain Marvel.
Some fans may know that the DC character now going by Shazam is the superhero formerly known as Captain Marvel.
Technically the Billy Batson Captain Marvel existed first as he was introduced in 1940.