What exactly is HotSpot and how does it relate to JVM and OpenJDK? Is it a library? What exactly does it do?
Also, what is the difference between OpenJDK and HotSpot?
The definition of what exactly is a Java Virtual Machine is stated in the Java Virtual Machine Specification
The JVM is by definition a virtual machine, i. e. a software machine that simulates what a real machine does. Like a real machine, it has an instruction set, a virtual computer architecture and an execution model. It is capable of running code written with this virtual instruction set, pretty much like a real machine can run machine code.
HotSpot is an an implementation of the JVM concept. It was originally developed by Sun and now it is owned by Oracle. There are other implementations of the JVM specification, like JRockit, IBM J9, among many others.
See List of Java Virtual Machine Implementations
The OpenJDK is a project under which an opensource implementation of HotSpot (and many other pieces of the JDK e.g compiler, APIs, tools, etc) is developed.