jonatj89:
What I am unsure of is why is the 100ohm resistor is used when 5V and 100ohm will send 50mA to the digital pin.
Do you mean the pin is pulled to ground with 10K, and then connected to 5V via 100 ohm when pressed? That could send 50 mA but it won't because an input pin is high impedance. It would only be a problem if you configured the pin as output and set it low. In which case 100 ohms isn't really enough.
As Osgeld said, the simplest is to configure the internal pull-ups and manage without any resistors.