Is flash just used to run away or chase?

No, flash can be used for a variety of things

What can it be used for?

If you pay attention to a bar right above your  character when you cast certain abilities, that's an indicator that you can use a "flash trick"

What is a "Flash Trick"?

It's where you can flash during an ability to either change the direction the person goes(such as a lee kick or vayne condemn) or makes it far harder to dodge(such as casting an ahri e and then flashing) It gives them a lot harder time to react and lets you go over minions and catch them off guard