Doing pistol squats on an elevated surface makes it easier to dial in some of the technical aspects such hip control and balance. This is why many people might benefit from doing them on an elevated surface.
There are some downsides though and you don’t want to spend too much time doing single leg squats on ledges or boxes. Strive for the full-on flat foot on the floor as soon as possible.