An "affair" or "fling" is an intense physical romantic relationship with no long term objectives. In many ways it's related to what we now call "Friends with benefits" or "Booty Calls". (This type of "fling' or "affair" I'm referring to is between two single people) This arrangement isn't intended to lead to wedding bells.
A lot of "affairs" take place because two people are either working closely together or someone is away from home in a new town, state, or country for an extended amount of time (month, Summer....etc). They meet a native and things take off. However when the assignment is finished both people go back to their previous lives.
Unfortunately the term "affair" is also used for those who are in marriages but have sex outside of their marriage repeatedly with one or more other individuals. In fact in our modern times the word "affair" is now more assoicated with "cheating" than it is with single people having a "romantic fling" for a short time.