The idea behind setting the grid in Grand Prix racing is simple: after two 15 minute sessions, the rider who sets the fastest lap gets to start from pole position, the other riders ranked in order of their best lap times. Of course, the fact that qualifying is split into two sessions to prevent people using tows to artificially boost their starting positions (more on that later) is already a distortion, as the quickest riders left in Q1 have sometimes posted faster times than those who made it through to Q2.
Sometimes, though, the rules intervene to create an egregious breach of the idea that the rider on pole is the quickest rider on the grid. Riders have laps taken away from them for all sorts of reasons, and the grid is set by those who adhered most strictly to the rules. As Race Direction gets ever more technology at its disposal to help assess infractions of the rules, the breaches it finds look more and more petty and mean-spirited, no matter the intention of the regulations. And sometimes, the choices made by track designers, on where to put the marshal posts and flag stations, can make adhering to the rules nigh on impossible.