Permanent magnet synchronous motor. Whichever pole on power up that results in movement will cause it to spin, and the direction is going to be somewhat random, though to ensure it always spins the manufacturers of the magnets always do not magnetise them to be perfect, the magnetic axis will be a little bit off from the actual shaft, so that, even if it is perfectly in the middle of the 2 poles, there will be a slight difference in field between the ends, so it will move a little, and thus keep on spinning.
They rely on the pump not having to start against a head of water, so that the impeller can build up momentum in the first few cycles, before it starts to get appreciable head of fluid opposing it. Also very inefficient, but for the application perfect, as it can pump small solid particles without clogging, and if it does jam, the likelyhood of the rotor turning the other way with the next cycle is high, making them somewhat self clearing. Also large clearances, so they often can pump small amounts of sand or pebbles out via the hose, though long term it will destroy the pump.
Most common cause of failure is the stainless steel shaft wearing from fine silt, causing the rotor to bind in the housing, or the actual acetal bearing on the shaft doing the same, though I have seen them lose the impeller when the half turn clutch, there to allow it to run up before engaging the impeller, snaps off from old age or too many jams.
That is why you always hear the controller on the machine do multiple starts, one or two seconds of operation, spaced one or two seconds apart, for 5 or so times, so the pump can break free if it is dry, and has been stuck from detergent residue.