From time to time we’ve been given more details of bits and pieces of the architecture, but the platform is surely changing too, so we’ll never know everything.
SmartApp code “obviously” contains metadata, so it cannot just be converted by Java-bytecode and thrown into a VM - At the very least, it has to go through a pre-processor.
There is likely entire abstraction layer(s) of various sorts. We’ve been told, for example, that one JavaVM can run multiple SmartApps concurrently from different Accounts. For this to be secure, developers obviously can’t push “arbitrary” Groovy or Java. Only certain libraries are permitted, and we can’t create global variables or global objects / methods, and so on.
But a lot of this changes in the new API, where SmartApps are just a data structure, event director, and scheduler. All executable code (and processing of it) will be the responsibility of the developer… i.e., run in their own AWS environment or other server. SmartThings will no longer accept new Groovy-based SmartApps.