In my view of it, flirting is just your basic social interactions delivered with a little sugar. It's simply a way of engaging with someone that flatters and notices another as a person. There are some people who "flirt" with everyone...particularly, for example, salespeople. They know how to engage with people in a flattering way in order to make the sale. They'll compliment a woman's hair, or a man's suit, etc. There are people who go through the world flirting with others because it allows them to get their way in most situations.
There are others who reserve flirting exclusively for the opposite sex...and it may or may not involve any actual pursuit of that person. I have a brother, for example, that is flirty with every woman he comes across. As a result, women looooooooove my brother. They think he's "such a cool guy." The vast majority of them are not interested in dating him (nor he, them), but they do find him charming.
Finally, there are people who only flirt with the opposite sex when they are specifically interested in that person. It's a way of showing their interest and hoping that the other person returns it.
In regard to the third group, there are actually sociological studies of flirting and what it involves--lots of eye contact, body language (feet turned toward each other), conversational banter, some non-sexual touch on the part of the woman toward the man (removing lint, laughing and touching his arm, etc.), a returned non-sexual touch from the man (moving a fallen piece of hair out of the way, touching her shoulder, etc).