Javascript is a weakly typed language, which means it tries to convert data for you when it can.
And it specifically has a string concatenation operator: '+'
So when it parses your code and sees this:
var num1="5";
var num2="3";
var sum=num1+num2;
It looks at the actual datatypes you have given it and because at least one of them is a string it decides to use the string concatenation operator and combines the strings - so you get a string result "53"
But...there is nothing sensible that can be subtracted from strings - so there is no "string deconcatenation" operator. So when it encounters this:
var num1="5";
var num2="3";
var sum=num1-num2;
it has to use the subtract operator, and converts each strign to a number first - so you get 5 - 3, or 2