Well it did start as party music. But to discredit party music as mindless is too hurtful to the genre. Basically, Hip-Hop's instrumental origins come from DJs taking the "break" or the instrumental rhythm part, and repeating them, crossfading them with other song's breaks, and adding turntable tricks along the way. The lyrics in this case came from the DJ announcing moves to the breakdancers.
This had a lot of importance because breakdancing was seen as a way of expressing and getting rid of aggression, rather than through violent means. These blockparties were an important part of the culture and of breaking down tension.
This was eventually mixed with Hip-Hop's vocal influence: poets like Gil-Scott Heron and America's take on the Jamaican art of "toasting" as popularized by Bootsy Collins and Bob Dylan. When these two forms combined, that's when the New School Of Hip-Hop really formed, where artists like Run-DMC and LL Cool J took both aspects and combined them into a completely new sound.
If you haven't seen it, I'd recommend the doc Rhyme & Reason. It's on Netflix, and follows Hip-Hop from its inception in 1975 up until 1997 when the doc was made. They interview a bunch of legends like Ice-T, KRS-One, Pharcyde, Run-DMC, Dr. Dre, Heavy D, Notorious BIG, Ice Cube, Ras Kass, Q-Tip, Arrested Development, Da Brat, Salt & Pepa, Wu-Tang, Redman, and so many more.