This is originally a military reference dating back to at least the Vietnam War. A grunt is a slang term for a soldier in the infantry, typically one of lower ranks.
The "front-line" reference is also carried over from the military context and here transfered to the worker (=grunt) who is tasked with the menial and often dirty or physically exhausting jobs or, in a second step of abstraction, the office worker with the most basic tasks and little personal power.
Modern computer games have picked up the expression and labeled or named "lower" (=weaker, typically appearing in larger numbers) units or enemies "grunts".