A raag in Indian classical music can be thought of as a generative system or framework – a set of rules and guidelines within which a musician can improvise, producing an infinite amount of variations. Both these pieces are based on the same morning raag:
A raag is based on 5-7 notes, and has predefined sequences of ascending and descending notes, and a set of phrases to be used. It may define the most and second-most prominent notes, and notes to avoid. There are rules governing the selection of notes and creation of phrases (which I don't completely understand – the internet is not the best resource for this :| ). There's no limit to how long a raag can be, and the improvisation within these rules should still reflect the time of day, season, and emotional quality the raag is intended for.
The Hindi/Urdu word "rag" is derived from the Sanskrit "raga" which means "colour, or passion" (Apte 1987). [...] may be thought of as an acoustic method of colouring the mind of the listener with an emotion. [https://chandrakantha.com/articles/indian_music/raga.html]