Why was the first Crusade successful compared to the last two crusades (Mahdia and Nicopolis)?
One of the major reasons that the first crusade was successful when compared to later efforts was the very fractured nature of the Muslim world at the time of the first crusade. The divisions within the muslim world created opportunities for relatively weak crusader armies to take Jerusalem and establish crusader states in what is now Turkey and the Middle East. The divisions that were later overcome to provide greater defense and communication within the muslim forces were in part overcome because of the success of the first crusade and the fear of later actions of the European "crusaders."
In contrast to the huge numbers in the first crusade, the later crusades, in particular the Mahdian crusade was far smaller both in the number of men involved as well as the goal, in this case mainly to reduce the pirate stronghold of Mahdia. The siege was ultimately unsuccessful and the crusaders negotiated a settlement after being mauled by a relief army sent to protect the city. The better organization within the muslim world led to significant improvements in the effectiveness of the muslim response to incursions.