Hi @yolomeyo2 , welcome to the forums!
The と in the phrase indicates the result of a certain action or state. 何百回と, functioning like an adverb here, refers that the number of failures reaches hundreds of times as the result.
Other examples of this usage of と include: 二回三回と注意した (I warned them two and three times), 雨が雪となる (rain turned into snow), and 彼は伝説となった (he has become a legend).
In the pattern of ‘the number + と’ such as 何百回と and 二回三回と, と can be grammatically interchangeable with も to shift the nuance from ‘finally reaching the number’ to simply emphasizing ‘many times.’
The other と can usually be interchangeable with に. The general nuance difference between the two is that と is used for a change with twists and turns and focus on the result, while に is used for a more natural change. Also, と may sound a bit more bookish and formal.
I hope this answers your question!