During the 1960s the term underground acquired a new meaning in that it referred to members of the so-called counterculture, i.e. those people who did not necessarily conform to the mainstream of human experience such as e.g. hippies.

Applied to the arts, the term underground typically means artists that are not corporately sponsored and don't generally want to be.

It can also mean that something is really groundbreaking and therefore is not mainstream.

Perhaps the best way to define it is a quote by Frank Zappa:

"The mainstream comes to you, but you have to go to the underground."

An alternate usage of the term "underground" is in reference to something that is illegal or so controversial that it would be dangerous for it to be publicized. Or it's so controversial (as in, offensive to societal norms) that it will never be mainstream. Some authors/artists use this as a badge of pride.

Examples:
An underground club might have illicit drugs readily available.
A movie is banned because people might imitate the actions of the characters.