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