They both are used in a very similar way, but they do have a difference.
"escape" is generally used when you can't freely decide to (or shouldn't) leave a place, or you are trapped. For example: "He escaped prison". "The mouse escaped from the trap."
"flee" is used when you decided to leave a place, and that's why it is sometimes used to refer to cowards. Example: "That coward fled the battle!".
The following similar sentences may help to further explain the difference:
"She escaped the country." -> It means that she wasn't supposed to leave (it may have been that she committed a crime and the police was searching for her).
"She fled the country." -> It means that she decided to leave, maybe because the country was very dangerous and decided to move to another one.