programs compatible with different processors
The intel line of processors (8086, x86) have backwards compatible instruction sets (i.e., unless you tell an x86 otherwise, it will behave like a 8086, and the 8086 instructions (and registers, etc) are just a subset of the x86 ones. Ditto for AMD64 (i.e., x86_64), they are able to run x86 software as is. This for pragmatic compatibility reasons: buying the shiny, new machine with the latest processor, and having it run your extant software in a slow emulator is not a way to make new buyers. So the 80286 could run 8086 software (operating system and all), and so on up. You can install an 32 bit (x86) operating system on x86_64 (64 bits) too.

ARM is a completely different kettle of fish, but also compatible (to an extent) along the line.

Besides, running software on some sort of virtual machine (Java Virtual Machine, .NET, ...) has advantages as the same "binary" runs on more platforms (simplifying the logistics of getting "the right version" to the user), today's processors are so ridiculously overpowered it doesn't make much of a difference for interactive applications. Besides, the Just In Time compilation technology has become the tool of choice, even rivaling native compiled binaries for some uses.