Answer based on context:

For the third straight game, the Niners jumped out to an early lead, only to be shut out for the remainder of the game. And for the second straight game, mistakes and penalties allowed their opponent to take the victory. The Niners had pulled out to a 14-6 lead with 5:07 remaining in the second quarter, but saw the Cardinals score 17 unanswered points for a 23-14 victory. The Niners failed to score the last six times they had the ball, and racked up nine penalties for 107 yards, most in the second half.

Why did the Niners lose?
mistakes and penalties