Emphatic adverb used in formal or rhetorical statements to express strong conviction. The や adds a classical, resolute nuance, often found in speeches, literature, or solemn promises.
I will most certainly succeed.
彼は必ずや戻ってくると信じている。
I firmly believe that he will definitely return.