The difference in height between the current and target altitudes is used along with the rate of climb to compute the time to climb. The distance to top of climb is then computed based on the ground speed and the time to climb.
Quick rule-of-thumb for mentally calculating Top of Climb
The Top of Climb can be roughly approximated by a general quick rule-of-thumb:
How Rate of Climb is computed
The computer calculates the time to climb by dividing the distance to top of climb by the ground speed, and then uses the altitude to gain divided by the time to climb to determine the rate of climb.
Quick rule-of-thumb for mentally calculating Rate of Climb
The Rate of Climb can be roughly approximated by a general quick rule-of-thumb: