The premise is that your productivity more than doubles. Part of the gain is realized right away (e.g., before code is checked in) and part is realized further on, when there are fewer bugs and failures.
When I teach students with two semesters' experience, for most pairs their productivity more than doubles because they ask each other questions and they learn and finish faster. But it's not universally true; a badly matched pair can take longer and do worse than the more skilled half.