Hello there,
All USB devices contain a collection of information about the device, called the descriptors. Device descriptors are retrieved from all devices with the same command. This allows a device driver for the USB bus itself to effectively ask a newly connected device what it is, and expect to get a reasonable response.
Of all the descriptors, only a few are directly used to match drivers to most devices. This is because USB defines classes of devices, and usually the system driver for each device class is sufficient to handle any devices that claim to be in that class.
All keyboards will claim to be in the HID (Human Interface) class, as will mice, tablets, and game controllers, for example. The HID class has several subclasses (keyboards, mice, etc.), so each gets handled in the expected way.
Most disk-like devices will claim to be in the Mass Storage class, and the system driver just works for those as well.
In addition to the class and subclass, the descriptors also include a vendor ID (VID), product ID (PID), and revision.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer–