Harris correctly understood that you have to beat the front-runner if you want to be the front-runner. Yet if you come at the front-runner, you had best not miss.
Harris benefited from her attack because Biden was not sharp enough to press her on the issue (or believed he would suffer from appearing too aggressive himself). That lack of sharpness—real or perceived—may ultimately help Harris or hurt Biden more than the substance of the issue.
Harris was also aided by debate moderators caught off-guard, or too inclined to see Biden hurt, to follow up on the issue. She is further helped by the belated follow-up occurring during the Independence Day holiday weekend, when few casual viewers will notice. In sum, it was a successful attack, but one that could have backfired in a highly damaging way in the moment. Am element of luck was involved.
Harris climbing out on limbs is part of an underlying pattern of high-risk publicity-seeking. For example, during the confirmation hearings for Justice Brett Kavanaugh, she raised her profile by asking the nominee: “Have you discussed the Mueller investigation with anyone at Kasowitz Benson Torres, the law firm founded by Marc Kasowitz, President Trump’s personal lawyer? Be sure about your answer, sir.”