Because the .backward() performs accumulation on each variable with requires_grad=True. That why we call optimizer.zero_grad() before each .backward() in training phase.
Thus, it is clearly to know, x.grad=1 after the first .backward() and x.grad=2 in the second time.