[ Arduino UNO ] Button state change

What does a pull up resistor do?

For low currents, it pulls up to (or very near) the supply rail.
But it limits the current available.