tailslide already gave the answer mah. The whole idea is to
prevent the engine from over-reving and damaging the internals of
the engine block. Doesn't matter if its an auto or manual car. It's
all controlled by the car's ECU.
For some cars, if the ECU detects a malfunction within the engine
system itself, it can limit the RPM to for example, 3000rpm. A
warning light will appear, usually indicating that the engine has
got some malfunction and requires immediate attention... which
means get it to the service workshop asap.