To further explain modulation, consider this simplification:
You have a red laser which is on all the time, so it’s like having a continuous stream of a optical source or carrier.
A carrier is the frequency at which the energy is “carried” and for radio/tv signals is measured in hertz (Hz) or millions of hertz or billions of hertz (MHz, Ghz).
All frequencies have a corresponding wavelength and due to the fact that light is actually very very high frequency radio (electromagnetic waves) it’s more convenient to express the wavelength in nanometers (nm) rather then MHz or GHz.
The wavelength of red light is around 700nm.
Now comes the problem, natural light also contains red (plus other colours) and your sensor picks this up.
How is the sensor going to know what comes from where?
Up to now I have only mentioned a single wavelength or carrier like a normal light or laser or the sun.
To be able to differentiate our light source from others, let’s make the carrier pulse on and off at some rate.
It now has a “signature” that the others don’t have.
This is known as adding a sub-carrier.
We change (or modulate) the main continuous carrier with our sub-carrier and transmit that.
Now when the sensor receives our signal, the first thing it does is strip the main carrier and is left with the sub-carrier only.
It amplifies this sub-carrier (as we are only interested in it’s presence) and sets a circuit that will give a digital output that is high for as long as our carrier and sub-carrier is present.
Look at drawing 1 which shows the “transmitter” (your modulated laser).
Then look at drawing 2where it shows the receive side (your sensor and demodulation).
Hope this makes it clearer for you.
This is the way all remotes work (TV remote, car key FOB) just that in those applications, multiple functions are required and depending on which button is pressed, different data is added to the sub-carrier.