Coconut oil is added to melted chocolate to achieve a shiny and glossy appearance when the chocolate coating sets.