When Android starts up, the DalvikVM looks thru all of your applications (.apk files) and frameworks, and builds a tree of dependencies. It uses this dependency tree to optimize the bytecode for every application and stores it in the Dalvik cache. The applications are then run using the optimized bytecode. This is why when you install a new ROM, sometimes it takes a very long time to boot for the first time. Any time an application (or framework library) changes, it's reoptimized and the cache is updated.