In Elizabethian times, nobility and cosmic order was vauled, Shakespear recognises that in the end we are all "food for worms" wether we are nobility or a commoner, but he had to also please the nobilty, hence forgrounding Hamlet, Gertrude and the king, Rosencrantz and guildenstern are backgrounded and made fools, becasue they symbolised the common man, who was not valued at the time. "we are nothing sir"
Stoppard was writing in the swinging sixties, no longer was nobility valued, and in replacemant, the common man was valued, so Stoppard forgrounded the backgrounded, hence making R&G the protagonists and making the nobles fools.
That is just one aspect of the text though, so just refer to the authors contexual influence.