Bigger wheels allow to "climb" higher obstacles. As the usual direction of movement is forward, bigger front wheels allow for rougher terrain (while the rear wheels may be "dragged" over the obstacle). Big wheels in front and rear would allow for even rougher terrain. But as the space available is limited, you have to make compromises.
The same is applicable to earth moving machines like tractors.
Rear wheels are bigger which help encounter obstacles and also provides traction which with large contact with the soil / surface.
Large wheels are basically to provide the traction and keep the movement while as small wheels help in direction. Small wheels are generally swiveling or pivoting to take take care of direction.