Javascript is a loosely typed language, so typecasts are done at runtime whenever the interpreter feels it is needed. If you compare an integer to a string, it figures that they should be the same type, so, for example, "34" == 34 is true, since the integer would probably be typecasted to a string before the comparison.
The string "false" isn't typecasted into a bool, instead the bool false is typecasted to a string, which would acctually have the value "0", that is, a string containing the number 0, giving "0" == "false", which is obviously false.
If you want to compare the value without automatic typecasting, effectively comparing types as well as values, use a triple equal:
5 === "5" false
"string" === "string" true