Chances are the hat is infused with Joyboy's haki, Roger's haki, and Shank's haki. And the giant straw hat in Mariejois is probably chock full of Joyboy's stored haki. The hat's stored Joyboy super haki attracted the giant robot so they had to freeze it to keep the robot away because haki is organic or something idk fuck.
Everyone's a damn fraud.