Ubu Roi was a play meant to comment on the political and social structures of its day. Jarry achieved his commentary through a mixture of theatrical writing styles, and beginning with a style that preceded Jarry, Farce. In Farce, events are comic to the extreme, with characters and coincidences exaggerated to a degree that almost seem cartoonish. This exaggeration could produce a sort of shock effect on the audience, which seems to have been one of Jarry's main goals.
Jarry is also credited with being one of the first playwrights to create a play in the Theatre of the Absurd. Things happen onstage with no reasonable explanation for their appearance or occurrence, and this lack of logic creates the sense for the characters (and the audience) that life itself is absurd.
The world, at the time in which Jarry was writing, was in huge upheaval. The early 20th century saw much technological advancement but also the ushering of what we call "Modern" art. This idea that art should be more subjective than objective probably had an impact on Jarry, as did the political and social upheaval of the time.
And so, he created a play which could not only be called Absurd, but which stirred audiences out of their complacency and apathy.