乘 here means 'to make use of', not 'to ride': you take advantage of the cool. The saying
大树底下好乘凉 'it's cool under a big tree' means it pays to have a powerful patron, and
前人栽树,
后人乘凉 'earlier generations plant the trees, later ones enjoy the shade' means benefiting from the work of those who came before.