On some IRC networks, you will notice users with odd "random" nicknames, such as "21WACCEVW" or "17SAAFLVL" – always beginning with a number and always 9 letters long. This is especially common during/after netsplits on large networks such as freenode.
Those nicknames are called "UIDs", short for "unique ID". In almost all modern IRC link protocols (TS6, P10, IRCnet…) an unique ID is assigned to each connection, and server-to-server communications always refer to users by their UID; only on very rare occasions the current nickname is used. This helps with avoiding many problems that used to occur in earlier protocols, such as a chanop trying to kick someone but the victim changing their nickname faster than the "KICK" command travels across the network and reaches their server.
Normally, all users only see their regular nicknames, and the UIDs are not exposed directly anywhere. However, sometimes a nick collision happens – two parts of the network link together, both introducing users with the same nickname (which is forbidden normally). When the network is operating normally, a collision might still happen if two clients on different servers try to claim the same nickname at the same time.
Since IRC does not allow two people to have the same nick, such collisions must be resolved; in the past, the "losing" connection would simply get killed, i.e. disconnected from IRC. (Usually the older one wins, although some protocols reverse this if both connections come from identical hostnames.) This may cause some annoyance, especially if the collision ends up killing the last op in a channel… Indeed, in the past, it was not uncommon to intentionally collide someone out of the network, e.g. to take over their nickname.
Because of this, some IRC servers instead "save" both clients – instead of getting killed due to a collision, the losing client's nick is forcefully changed to its UID, without affecting anything else like its status in channels.
The UID is used here simply because it will never be in use by anyone else. (UIDs start with a digit, which regular "/nick" does not allow; they also start with the server ID, so it is impossible for two servers to assign the same UID.) If, instead, the server tried to choose a "normal" nick – e.g. change the losing side from "grawity" to "grawity2" – the new nick might easily cause a collision again.