The difference arises when you have arrays within arrays. Taking from here, let's create two arrays:
$base = array('citrus' => array( "orange") ,
'berries' => array("blackberry", "raspberry"),
);
$replacements = array('citrus' => array('pineapple'),
'berries' => array('blueberry')
);
If we do
$basket = array_replace($base, $replacements);
We will get
Array
(
[citrus] => Array
(
[0] => pineapple
)
[berries] => Array
(
[0] => blueberry
)
)
where the array "blueberry" has replaced the array "blackberry","raspberry". If instead we do
$basket = array_replace_recursive($base, $replacements);
we will get
Array
(
[citrus] => Array
(
[0] => pineapple
)
[berries] => Array
(
[0] => blueberry
[1] => raspberry
)
)
Now the first element in the array "blueberry" has replaced the first element in the array "blackberry","raspberry". So it's an array replacement within an array replacement, or a recursive replacement.