to contend with all your strength: to throw everything you have into a contest you mean to win
Behind this word stands the Greek public contest, the ἀγών: a struggle staged in the open, with an obstacle or an opponent, a finish line, and a crown for whoever comes through. The verb is simply what a contestant does. Every use in the New Testament grows out of that one picture, and the strain is the point every time.
Two of its eight uses stay inside the picture literally. Paul points at the athlete who competes in the games and denies himself everything for a wreath that will wither anyway (1 Corinthians 9:25). Jesus tells Pilate that if his kingdom came from this world, his attendants would be fighting to keep him from being handed over (John 18:36).
The other six carry the picture into ordinary life. Jesus says to strain to get through the narrow door, because many will merely try and fail (Luke 13:24). Paul works himself to exhaustion at his preaching (Colossians 1:29), and he and Timothy "labor and strive" together for the same hope (1 Timothy 4:10). Epaphras does the same thing on his knees, wearing himself out in prayer for a church he is not even with (Colossians 4:12).
Twice the verb takes its own noun as its object, so the phrase reads roughly "contend the good contest" (1 Timothy 6:12; 2 Timothy 4:7). There a whole faithful life is one long contest, and the second of the two is spoken by a man looking back from the finish line.