How did minecraft programmers program plants to grow?
Do you want a code now? (almost) everything is possible
There are several ways to do this. I would guess that each plant has different conditions, see grain in particular. A counter runs for each object and if a certain time has been exceeded, the object changes to the "next higher" state and for the player it then looks as if the plant is growing.