Your fluid probably boiled, Boiling produces gas bubbles as within any boiling fluid. Gas is compressible so boiling brake fluid leads to a “soft” brake lever with long travel. Overheated brake fluid can (and will) boil in the calliper. Brake fluid is hygroscopic which means it readily attracts moisture from the atmosphere, and over time it get saturated with water to the point where it lowers the fluids boiling point.
You can compress a gas but you can’t compress a fluid. When you pull the brake lever you create hydraulic pressure in the hydraulic brake system which acts on pistons at the wheel end that actuates the brakes, imagine a bubble of air in the hydraulic system. Remember you can compress a gas but you can’t compress a fluid, so if there’s a bubble of air in the system then when you pull your brake lever and instead of the hydraulic pressure acting on the pistons for the brake all your effort is going to be used compressing the gas instead of working the brake.
Change your fluid and probably your pads, gear down next time to reduce you relying on your brakes alone.
Check your manual to get the correct fluid, any quality one will do you and change it every 12 months
TB