Two options:
- it's either a Zukey (mentioned in the other answers; it will act as a keyboard and "type" a one-time password/passphrase for the user)
or
- it's more like a USB Rubber Ducky, disguised as a Zukey. Such devices will also act like a USB keyboard and send useful keystrokes and/or mouse movements to the computer. More advanced devices can be remotely controlled.
"Useful keystrokes" (which can be sent a few seconds, minutes, hors after the device has been plugged in) can be commands to take over the machine, open an SSH tunnel or other remote network control connection, download or even type in malware, do funny things to annoy you - or just jiggle the mouse pointer so the machine will never activate the screen saver/screen lock.
One of the most popular ways to deliver such a "trojan horse" into some company's computer's USB port is by dropping them on the parking lot. Or, if you are a visitor or HVAP maintenance person who is allowed temporary access to a data center, you can plug it in yourself when your guard is distracted.
These things can also be used for non-malicious activities, like performing repetitive work which cannot be otherwise automated.
However, the stuff inside your device does not looks one of these "Rubber Ducky" or Arduino Leonardo-based devices.