First of all, you need to know what Haoshoku Haki is. It is a rare form of Haki that cannot be attained through training. Only one in a million people have this ability. Though it cannot be attained via training but one who possesses it can master it by undergoing rigourous training.
What is Shanks Power, If "Haoshoku Haki" then is it different from other user?
Now coming to your question, the difference between the 2 events you're talking about boils down to 2 points.
Superiority of Haki - Shanks has a highly superior Haki than Luffy and thus the effect/impact of his Haki would be far greater than that of Luffy's.
According to the wiki,
Oda mentioned in a SBS that Shanks could have knocked out all 100,000 pirates and fishmen opposing the Straw Hats during the Fishman Island Arc with his Haoushoku Haki (Luffy managed to overwhelm 50,000).
Usage of Haki - If you have a look at the wiki,
There have been two ways in which this Haki has been used. The first and most common way is in a quick burst that will knock out those with weaker wills relatively easily. The second method is to release it continuously, which will not only knock out those of weak wills around the user, but also put pressure on the surroundings, actually affecting other physical objects besides living beings.
Luffy happened to use the Haki in quick burst to knock out all the weak willed ones, whereas Shanks opted the second method to release it continuously, which not only knocked out the weak willed users, but all affected the physical object (the ship in this case) in the surroundings. Shanks was in Whitebeard's ship, and thus he had to be on guard always as both of them were the Yonkos at that time.