What is going on behind the scenes of an editor module?

Is an editor module basically one big if WITH_ENGINE flag? therefore the entire module’s code wouldn’t exist in the cooked game right?

If the editor module (which is used to create development tools) were to need some extra information from the gameplay classes, could I just put all of that extra information with WITH_EDITOR flags and all that code would disappear from the cooked project?

I guess my question comes down to what exactly is going on behind the scenes with an editor module and WITH_EDITOR sections of code