Classes exist as a bunch of bytes in some form, for example on disk. Before the JVM can use a class, it needs to put those bytes into memory. This is known as classloading. Classes are usually loaded automatically by the JVM as it needs them, but you can also control the loading of classes. Class.forName("fully.qualified.name") is one method of loading a class.
The JDBC driver mechanism is a factoring of the abstract factory pattern, you write your code to a set of interfaces (Connection, Statement, DataSource etc) but your Java code is unaware of which JDBC driver you are actually using. The designers of this mechanism decided to use classloading to provide a means of configuring the factory, which in this case is the DriverManager. At runtime, you simply load the JDBC driver class by name. The driver class has a static initializer which registers the driver with the DriverManager, so whenever you request an instance of any JDBC interface, the driver gives you a vendor-specific class which implements that interface
If you don't know what a static initializer is:
public class MyJdbcDriver implements java.sql.Driver {
static {
// exceptions omitted for brevity
Driver driver = new MyJdbcDriver();
DriverManager.register(driver);
}
// other methods here omitted for irrelevance
}