The statement you're referring to touches on a fundamental aspect of quantum mechanics, particularly in the context of wave-particle duality and interference phenomena, such as those observed in the double-slit experiment.
In the double-slit experiment, when photons (or any quantum particles) are sent toward a barrier with two slits, they can exhibit interference patterns typical of waves if both slits are open and the path of the photons is