A piece of white paper appears white in white light because it reflects most of the colors in the visible spectrum. White light is a combination of all colors, and the white paper reflects them equally, which is why we perceive it as white.
When you shine red light on the same paper, it appears red because the paper reflects only the red wavelengths of light and absorbs the others. Similarly, if you shine blue light on the paper, it appears blue for the same reason: it reflects blue wavelengths while absorbing the rest.
This phenomenon ultimately depends on the properties of the pigments and surface of the paper. White paper is designed to reflect a broad spectrum of light, while it can selectively reflect certain wavelengths based on the color of the light that falls on it.