I have a Honda Jazz, and sometimes when I step on the brakes it sometimes gets stuck. It's like there's compressed air preventing the brake pedal to go all the way to the bottom. As I release and step on it again, a couple of times it releases the air and goes back to normal. Everytime it gets stuck it doesn't stop the car immediately, it's scary as hell and I noticed the brakes got much more smoother.
Whenever it's stuck, it has this same kind of feeling. When pumping the brakes while the engine is off, the pedal range just gets shorter and harder to press down. When turning the engine it just goes back to normal. It's something like that but with the car running the entire time.
What could be the main cause of this?