Creating code that can be used by someone who doesn't understand the code is the way we use most of our electronics. Now, you'll have the ability to 'peek under the hood' and see what's happening when a button press activates a code statement.
As the code mentions, there are many different inputs to a system. A button is considered digital here because it can only be two things: pressed or unpressed. The other type of signals exist on a spectrum and are called analog. Think of a light level in a room: it has an infinite number of steps between pitch black and absolutely bright.