The circumstances of Captain Marvel's death in the comics are diverse. It could be from a combination of factors like being outmatched by a powerful enemy or succumbing to a long-term consequence of a previous encounter.
Captain Marvel has managed to defeat Thanos in certain comic arcs. The outcome often depends on various factors such as teamwork, strategic planning, and the powers she wields at the time.
Captain Marvel has had her moments against Thanos in the comics. Sometimes she beats him, but it's not a straightforward always or never situation. It all hinges on the creative direction of the particular comic series.