It is you actually
$cid returns the connection id. Each $cid is associated with a server window and the $cid for that server never changes. Although $cid's seem to be 1,2,3,etc you should just assume they are random numbers that uniquely identify a connection.
In your case you probably connected four times, and then closed the connection with $cid 2, leaving you with $cid's 1,3 and 4.
The identifier you want to use is probably $scon(N), this returns the $cid for the Nth connection, see /help $scon.