In a steady state, and for a given wing configuration (flaps/slats/spoiler positions), there's a causal relationship between angle of attack and speed (which also depends on air density, aircraft weight and load factor (how many gs you are pulling)), such that the indicated airspeed (which measures ram air pressure in a pitot tube, and fortuitously cancels out the density dependence) has historically been the proxy for angle of attack - and, at least in small airplanes, it still is.
Even small airplanes often have a separate stall warning device, which is triggered by the movement of the leading-edge stagnation point (where the flow divides between going above and below the wing) as the angle of attack changes. In its simplest form, it is operated by a small tab which is flipped up when the stagnation point moves below it.