This code recursively checks if string contains matching amount of opening and closing parentheses by calling balanced() on the string without first element.
Expectancy of parentheses in the string is kept in a kind of balance indicator open - positives indicate amount of needed ')' and negatives amount of needed '('. Initial balance is 0.
When recursion reaches end of string it checks if balance is ok (open == 0), e.g. there was matching amount of parentheses seen.
There is also a check (open > 0) to ensure that ')' wasn't encountered before there was '(' it could close.