The PA0 is connected to GND when button is not pressed. The cap is charged in this period of time. As the button is pressed, the Vdd finds a path and current flows through 220k ohms. The cap which is directly connected to PA0 now starts to discharge. The prescence of a capacitor is solely to remove the debouncing effect which is discussed in ************.
To blink the LED using USER button on board. The Code can be found over here :-
https://github.com/manvendra88/STM32/blob/master/LED_Button.c