The engineers that work at the car manufacturers generally take a lot of things into consideration in order to determine the redline. Things like:
Long term durability
Catastrophic failure (bending valves, breaking conn rods, etc.)
maximum accelerations of pistons, rods, etc
In the end, I'm sure everone on the design team agrees on a "safe" RPM that the engine can live at in the long term.