Okay, so you know how when you're playing with your toys, different toys need different instructions on how to play with them? Like your toy car might need you to push it forward to make it go, but your toy airplane needs you to throw it up in the air for it to fly?
Well, imagine if you made up some instructions for how to play with all your toys, but you only had to do it once. Then, you could use those same instructions to play with all your toys, even ones that have different ways of playing with them.
That's kind of what "write once, compile anywhere" means. When people make computer programs, they usually have to write different versions of the program for different types of computers or devices. But with "write once, compile anywhere," they only have to write the program once, and then a special tool (called a compiler) can turn that program into a version that will work on all kinds of computers and devices. It's sort of like making a toy instruction manual that works for all your toys, instead of having to make a different instruction manual for each toy.