Reading the visual signals
Unless you had the opportunity to sample every available option, the thing that made you opt for the more expensive option was not the actual value (i.e. how great it tastes), instead you were influenced by its perceived value (how great you believe it is going to taste).
Your primary motivation was to buy something high quality, because you wanted a special treat. So, you opted for the ones in the fancy box, because they did a better job of communicating the perceived value of the contents.