Both Canon 5DS R and Pentax 645Z have 51.0 MP resolution sensors but Canon 5DS R's sensor is Full frame (36 x 24 mm ) and Pentax 645Z's sensor is Medium format (44 x 33 mm ).
Since Pentax 645Z's has a larger sensor area with the same resolution, this means that it also has a larger pixel area hence better light collecting capacity for a given aperture compared to Canon 5DS R.
Another similarity between these two cameras is that both Pentax 645Z and Canon 5DS R sensors lack anti-alias (Low-Pass) filters. Removing anti-alias filter increases the sharpness and level of detail but at the same time, it increases the chance of moire occurring in certain scenes.
Below you can see the 5DS R and 645Z sensor size comparison.
As seen above, Pentax 645Z has a 1.7x Larger sensor area than Canon 5DS R. Larger sensors give photographer more control on the depth of field and blurry background compared to smaller sensor when shot in same focal length and aperture.