Fights over increasing the nation’s borrowing authority have been contentious in Congress, yet follow a familiar pattern: Time and again, lawmakers found a way to step back from the brink before markets began to panic and the nation risked a dangerous default on its debt.