Postgresql: percentile_cont interpolating values

I have some questions about percentile_cont in Postgresql. I'd like to know what algorithm it uses to interpolate values ​​when using percentile_cont?
My second question is: why should we use the order before? It seems odd to not order the default values ​​when using percentile_cont? I do not see why this choice was made. Could someone explain the reason for this choice?