The beginning of the end for MTV came with the emergence of the Video Jukebox (later known as just "The Box"), where you called in and paid to look at any video you wished to see at any time. That begat YouTube and the rest is history.
YouTube was created because of the Janet Jackson nip slip. One of the founders of Youtube was trying to find a video of the incident after it happened and couldn't, so he came up with the idea for YouTube. A year after YouTube was founded it was bought by Google who turned it into what it is today.