Just something I used to have a big interest in.
Yes the Mamelukes were a big factor. I’ve also heard it argued that the forests and high numbers of castles made Europe less than appealing for the cavalry based Mongols.
The Mameluks were not a big factor when it came to Europe. Different branches of the Mongol Empire were involved with the European and Mid East invasions. The Golden Horde attacked Europe, while the Il-Khans stormed the Middle East. Those two branches eventually started to fight each other, btw. Also, I believe that the Mongols lost about half of their invasion force in Europe.