|David Latimer and his 40yrs old bottle garden|
Because it receives sunlight, the plant can photosynthesise and grow (within the limits of its bottle). The photosynthesis process generates oxygen and releases moisture inside the bottle. When the relative humidity inside the bottle reaches the dew point, it usually condenses back on the glass and runs down to the soil.
As leaves falls, they eventually rot on the soil which creates carbon dioxide, which is needed for the photosynthesis as well as the nutrients absorbed by the plant's roots.
More details on his experiment on as well as bottle gardens on the original article of the dailymail.