Originally a baseball term meaning to try hitting a home run. Now used extensively by for example the commentators in the UFC and other combat sports, referring to fighters striking for each other with reckless abandon, trying to get in a finishing blow.
Also sometimes used in completely unrelated attempts at doing difficult or near-impossible things.
"And Ruth was able to hit more homers than some entire teams because he played the game differently – he swung for the fences at every bat." - DodgerDog
"...Cause they're both a little fired up, and both wanna swing for the fences and make the other one look really, really bad" - Joe Rogan, Commentator, UFC
Man, I had like...15 windows open on my PC at work today and only one of them was the report I was meant to be working on. Clicked from Facebook straight to YouTube when my boss appeared. Just a big-arse kitten playing a piano on my screen. Complete e-fenestration.