I am trying to wrap my brain around a proof that proves that there are arbitrarily large gaps between successive primes. The proof is
Given a natural number $N\ge2$, consider the sequence of $N$ consecutive numbers $(N+1)!+2$, $(N+1)!+3$, $\dots$, $(N+1)!+ N + 1$. Note that $2$ divides $(N+1)!$ since $2$ is one of the factors in the product that defines $(N+1)!$. So $2$ divides $(N+1)!+2$ hence $(N+1)!+2$ is composite. Similarly, 3 divides $(N+1)!+3$ and so $(N+1)!+3$ is composite as well. Analogously, all the $N$ consecutive numbers from $(N+1)!+2$ to $(N+1)! + N + 1$ are composite. Since the number $N$ is arbitrary, there are strings of consecutive composite numbers of any given length. Hence there are arbitrarily large gaps between successive primes.
What I don't understand is where the function $(N+1)! + N+1$ comes from. How does this relate to the gaps in prime numbers?