Why did knights become a distinct group, and when did they decline?

During 9th century of Europe local wars became common. There were frequent localised wars in Europe from the ninth century onwards Good cavalry was required for wars. The amateur present-soldiers were not good enough for those wars. This need was fulfilled by the knights. In this way, knights became a distinct group to achieve this aim. The fall of the feudal power resulted in the decline of the knight during the 15th century.