The JVM is the piece of software that loads/executes your classes. Any time you start a program with the '
java' command, you are launching a new JVM. For example, typing 'java MyClass' will launch a JVM which tries to execute the 'main' method in 'MyClass'. Any other classes that MyClass uses (directly or indirectly) will also be loaded by the same JVM. That is to say, they all 'live' in the same JVM.
When it comes to EJBs, your entire application may not be located on the same machine. Because you cannot have the same JVM running on different machines, different protocols are in place for how the different parts of the application talk to one another - you gave the example of local vs remote interfaces.