A powerful mantra, not unlike just go ahead in its essence. A basic human tool for coping with difficulty from the mundane to mortal peril. While it can be used to express mere frustration, more often it expresses a particular kind of frustration, and implies a particular kind of action to follow:
I am in an untenable situation. The rules I'm trying to obey are in conflict or are themselves unreasonable, and there is nothing reasonable I can do without breaking them. Fuck it, I'm going to break them and do something, anything.
Ever come up to a crosswalk without a light, and the oncoming cars tentatively stop, only to start again just as the pedestrians are reacting by moving forward, and the feedback is a little off, so you get in this irritating loop? Even if you don't verbalize it, when you break this loop by stepping back and giving up or stepping quickly forward and assuming the risk, your spirit is saying fuck it. This is a singularly ubiquitous and banal application of the phrase, but the classic heroes all said "fuck it", too: duty or necessity called, and self-preservation said "nuh-uh", and they broke the tie in favor of duty and did what had to be done.
In a frequently cited interview, Anthony Hopkins cites a Jesuit priest to the effect that "fuck it" ("...it's in God's hands") was the best short prayer he knew. That is indeed the principle here: you throw out the normal rules by which you operate, assuming a risk or giving up an advantage in the process, and commend yourself to Divine will or to chance.