They're using that $$1+2+3+\dots+n=\frac{n(n+1)}2$$
For example $1+2+3=6=\dfrac{3\cdot 4}{2}$
On the other hand $$\underbrace{1+1+1+\cdots+1}_{n \;\;\rm times}=n$$
Thus $$\frac{1+1+1+\cdots}{1+2+3+\cdots}=\frac{n}{\dfrac{n(n+1)}2}=\frac{2}{n+1}$$
Of course, we're interpreting $$\frac{1+1+1+\cdots}{1+2+3+\cdots}$$ as $$\lim\limits_{n\to\infty}\frac{\sum_{i=1}^n 1}{\sum_{i=1}^n i}$$
If we had, for example $$\lim\limits_{n\to\infty}\frac{\sum_{i=1}^{n^2} 1}{\sum_{i=1}^n i}$$
then we would say that $$\frac{1+1+1+\cdots}{1+2+3+\cdots}=2$$
We can write this more suggestively as $$\frac{{1 + (1 + 1 + 1) + (1 + 1 + 1 + 1 + 1) + \cdots }}{{1 + 2 + 3 + \cdots }} = 2$$ to make clear how many terms we add in each step.
The moral of the story is that you cannot have "voids" in your notation. Writing something like $$\frac{1+1+1+\dots}{1+2+3+\dots}=\text{something}$$
should be better replaced by something informative and clear that really says what is going on.