The pedal needs to be fully released to allow the return of brake fluid to the master cylinder. There is a very small return hole which allows fluid back, and this hole is sealed once the pedal is even slightly depressed. Without this, the fluid can heat up and expand - forcing the pistons out. As the pistons are forced out, the pads rub on the rotor, generating more heat and compounding the problem. By raising the pedal they clear the return path and all is good.
Sometimes dirty brake fluid can block this return hole with similar results.