There is also an element of "hard work" in the term "grind" (imagine grinding something- can mean the repetitive work of moving in circles around a millstone, or the act of being crushed into powder. All imagery suggesting hard work).
To answer your question, it possibly means being "stuck in traffic is like being in a repetitive, crushing situation that lasts from 9 am to 5pm".