As I read is bytecode an intermediate language which is used by a virtual machine which has to be installed on the computer to run the program. Wikipedia says, that a VM either executes the bytecode directly or generates machine code for better performance. The article also says, that bytecode is a set of instructions. For me it sounds like normal machine code, except that only the VM can understand it (Am I right?).
So what is the purpose of bytecode? If a VM can also compile it to machine code why can't the compiler do it directly and we don't need the VM and have better performance?