When we want a cup of tea our main wish is to drink tea, but to fulfill this wish we naturally develop the secondary wish to find a cup. In a similar way, the main wish of those who have great compassion is to protect all living beings from their suffering, but to fulfill this wish they know they must first attain Buddhahood themselves and so they naturally develop the secondary wish to attain enlightenment.