The leaf contains some pores called stomata for the exchange of gases. And these stomata try to use them as access doors to the inside of the leaf, but usually find the door closed.
For example, the Arabidopsis plant closes the stomata of the leaves one hour after contacting pathogenic bacteria. This was seen by some plant pathologists when they put the leaves of Arabidopsis in contact with various bacteria. The plant, in general, kept the stomata closed for hours. But with one of the bacteria it happened differently: at three hours opened the stomata. This bacterium (Pseudomonas syringae) had the access key inside the leaf.
Researchers have found that the key is a substance called coronatin. Coronatin resembles a hormone of the plant and causes the opening of the stomata of the leaf. Thus, the pathogenic bacteria enters the inside of the leaf to colonize the plant.