If the pawns in front of a castled king have never moved, the king has nowhere to run. If no piece guards the back rank, a single rook or queen can mate.
The easy defence: at a good moment, give the king an escape square with a move like h6 (h3 for White). This is called making 'luft'. Here Rd8+ is no longer mate; the king escapes to h7.