So that the variables a and b can be used in the body of the function, corresponding to _a and _b, but with the desired type. There is no advantage since the author could just have easily used x and y, lhs and rhs, a_ and b_, etc.

In fact, the is a potential disadvantage: in C++, names that begin with an underscore are reserved to the implementation for use in the global namespace, and names that begin with an underscore followed by an uppercase letter (or that contain consecutive underscores) are reserved to the implementation for any use. So, _a and _b are okay here, but not okay everywhere.