Perhaps it is even simpler. The system interprets the difference between the current AoA and the stall AoA as a margin between the current speed and the stall speed. So in the example shown below, if the current speed is 120 kts at an AoA of 9 degrees, it would place the stall speed bug at 100 kts.
P.S. The curve shown as an example to illustrate the principle is defined in the text box on the graph, with V/Vs=SQRT(CLmax/CL). It is typical of a large jet transport in clean configuration at low Mach numbers, and will be different for each airplane type. For any given airplane type, it is subject to the variations described in the Boeing article linked in post #22.