Consider the definition of a derivative:
A derivative is a security with a price that is dependent upon or
derived from one or more underlying assets.
Or as Wikipedia puts it:
A derivative is a contract that derives its value from the performance of an underlying entity. This underlying entity can be an asset, index, or interest rate, and is often simply called the "underlying".
You may think of CFD (Contract For Difference) as pools of assets. The total price of a pool depends on the individual price of each underlying asset in that pool. This further allows tailoring different groups of assets for all sorts of purposes. The price goes through some "adjustments" too - so simply summation of all the prices does not equal the price of an index.
Example being an index like DAX which has 30 underlying [assets|components|constituents|members] (whichever word you are more comfortable to use). [https://www.boerse-frankfurt.de/indices/dax - click on Contituents tab to see its components] You can use different screening tools for different indexes to see their underlying components.
Keep in mind that the underlying members keep changing from time to time. (Example being a recent new member to DAX, "DAX 50 ESG Index" which was created by Qontigo - Reference: https://www.dax-indices.com/press-releases-details?articleId=1722402906)
Quoting from libertex.com:
Before the digital era, calculating the price of a stock index had to be as simple as possible. The original DJIA was calculated using a simple average: add the prices of the 12 companies and divide that number by 12. These calculations made the index really not more than an average, but it served its purpose.
Today, the DJIA uses a different methodology called weighting based on price, where the components are weighted according to their prices. To calculate the index, the current prices of the 30 shares are added and then divided by what is known as the Divisor Dow, a number that is used to maintain the historical continuity of the index. This number is continuously adjusted to take into account changes in the market, such as equity divisions, spin-off and any changes in the Dow components. In 2008, for example, the value of the Divisor Dow was 0.125553. Today, it is 0.14602128057775.