CustomEvent should be used when you need to pass custom data with your event through the detail property. While both Event and CustomEvent can be used to create custom events, CustomEvent provides the detail property specifically designed for carrying custom data. This makes it more suitable for application-specific events where additional context or data needs to be passed to event handlers. The detail property can contain any type of data (objects, arrays, primitives) that event listeners might need.