For automatic driver installation specifically:
Windows installs drivers automatically if they are in-box (that is, included with the OS), or if they are on Windows Update and you have the optional (but I think enabled-by-default) feature to search Windows Update for needed drivers. In both cases, these drivers will be "blessed" by Microsoft with a WHQL (Windows Hardware Qualification Labs) signature - this is necessary to install a driver in 64-bit Windows at all, unless you mess with the boot parameters - meaning that they have been tested for some level of correctness and also come from a known, verified vendor.
Note that WHQL signatures, and even in-box or WU distribution, do not guarantee that the driver has no security vulnerabilities. Driver security is a complicated topic that lots of hardware vendors make mistakes on - there was a high-profile case recently where NVIDIA's graphics driver was found to have some serious vulnerabilities and they pushed an urgent patch - and of course drivers have such a privileged position that vulnerabilities in them can compromise the entire system. On the other hand, if a driver isn't loaded, it doesn't matter how vulnerable it is, and loading a driver requires Admin privileges so low-privilege malware can't just load a known-vulnerable driver to gain an EoP vector.
WHQL also doesn't guarantee the stability of the driver, beyond for basic steps like loading and unloading. Driver instability has long been a leading cause of kernel panics (Blue Screens of Death), though it's unlikely for any WHQL driver to cause a BSOD just from plugging in its hardware.
Also, depending on the phone and how it's configured, the phone itself might not need its own driver. A phone that is connected in USB Mass Storage (UMS) or Media Transfer Protocol (MTP) modes will use a generic Windows driver that supports such modes. These drivers are written by Microsoft and subjected to extensive testing (though of course there can still be bugs).
Do note that, for "active" multi-function devices like smartphones, there may be many different drivers, as the device can present itself as any kind of USB device or even as a hub (which has its own generic driver) with many different devices connected to it.
Outside of drivers specifically, smartphones could also be used for other attacks. There are many kinds of malicious USB devices out there, such as "Rubber Duckies" that type attacker-chosen keystrokes at superhuman speed, or even a "USB Killer" that uses a large power surge to destroy the USB port and possibly other components. Plugging in unknown, untrusted USB devices is risky behavior, and that includes phones!