Without the resistor, a released button leaves the pin floating: it picks up noise and reads random highs and lows. The pull-up gives it a defined high, and pressing the button connects it straight to ground, which wins.
Current when pressed is tiny: 3.3 V ÷ 10 kΩ = 0.33 mA. The logic is active low: the pin reads LOW when pressed.
Most microcontrollers have built-in pull-ups (pinMode(pin, INPUT_PULLUP) on Arduino), so the external resistor is optional there. Keep it for long wires to a panel button, or for chips without internal pull-ups.