Many are spring-loaded and the mechanism is the part that fails.
A cup holder is replaced when the spring has gone and the holder no longer grips, when the retractable mechanism jams, or when a spill has left the insert sticky and discoloured. On consoles where the holder is part of the console moulding, the replacement is a larger piece and the console has to come out.
Match by position and by console type. Front and rear holders are different parts, and a holder for a console with a sliding cover has a different surround from an open one. Where the holder sits in the rear armrest, the armrest part number decides the fitment.