Used like "what the hell" to add emphasis.
A minced oath, an expression of dismay, disgust, anger, surprise etc.
Really?; no kidding!; is that so? (sometimes used sarcastically in response to the obvious)