The origins of this tradition can be traced back to the ballets in Indian dance-drama. Traditionally, these song-dance sequences are considered to be an outlet of the intense expressions of the lead characters of the movie. So they are picturised on the lead characters.
During the 1940s, the camera was more or less immobile, focussing only on the facial expressions of the artists, while the music was heavily based on Indian Classical Music.
During the 1950s and 1960s, when technology facilitated mobility of the camera, Indian filmmakers shot musical sequences on location at scenic spots such as Kashmir. The score and lyrics were still inspired from folk and traditional music.
During 1970s, the visual media was dominated by movers and shakers kind of dance. The auditory media was also more western with instruments like guitar taking a dominant role.
The music is typically seen as a safeguard by Indian movie producers that adds value to the movie. Some movies are known to have earned money solely because of their music.