The biggest advantage is that you are reducing how much grime actually reaches the shelf. A small spill of turmeric, flour or cooking oil can be annoying to scrub off a wooden or laminated surface. With foil underneath, much of that mess lands on a disposable layer instead.
It is particularly useful for shelves near the cooking area, where airborne grease can settle over time. Instead of having to scrub a sticky film from the shelf itself, you can periodically remove the foil and replace it. It can also make deep cleaning less frequent. You will still need to wipe the shelves occasionally, but the protective layer can make everyday maintenance quicker.