What made it so dangerous for them to rap?
Rappers like Big L, Tupac, Bugz, Biggie Smalls, Soulja Slim, Jam Master Jay were all murdered.
A lot of rappers back then also sang about the dangers of rapping. An example is Eminem's "Like Toy Soldiers" where he sings about how they used to be able to sing without worrying about being killed:
"It used to be a time where you could just say a rhyme, and wouldn't have to worry about one of your people dying."
And another example from his diss track "Bully" where he sings about all the killed rappers:
"Now what bothers me the most, about hip hop is we so close, to picking up where we left off with Big and Pac
We just lost Jam Master J, Big L got blasted away, plus we lost Bugs, Slang Ton, and Freaky Ta"
What changed the rap genre to make it so violent and why doesn't it seem to be as violent as it was anymore?
Firstly, I think that part of the premise of your question is incorrect, and that it wasn't that common for rappers and hip-hop artists to be murdered in the 1980s. Instead, it's in the 1990s and 2000s when this was somewhat more common (Googling suggests that all of your examples apart from 2Pac and Biggie are from 1999-2003).
The most obvious contributor to this was the ideology of authenticity which sprung up around the 'gangsta rap' movement. In the 1980s, hip-hop was basically party music - rappers did not typically tout inflated criminal credentials or membership of gangs, and instead the bigger acts - Run-DMC, Grandmaster Flash And The Furious Five, LL Cool J, or Public Enemy - made no particular claim to be authentic representations of 'the streets'.
However, in the wake of the crack cocaine epidemic of the late 1980s, rappers like N.W.A claimed to be portraying the black community as it allegedly really was, complete with descriptions of gang violence, misogyny and sexual assault, and boasts of outlaw behaviour. This wasn't the only style of rap which had mainstream success in the early 1990s - beyond the Vanilla Ices and MC Hammers of the world, there was a 'conscious hip-hop' movement involving the likes of Arrested Development and De La Soul which had been very popular - but it was a prominent one.
But in 1992/1993, the 'G-Funk' of Dr Dre and Snoop Dogg became the sound of hip-hop - witness MC Hammer's ridiculous 'Pumps And A Bump', which took the 'G-Funk' sound, and added, mostly, a thong. This success was partially thanks to the support of MTV (who thought that its boasts of violence would appeal to its white male teen core audience, as cartoonish violence often does); thanks to MTV, gangsta rap rapidly became a very popular mainstream genre indeed. This wasn't celebrated by some of the hip-hop community; the drummer in the conscious hip-hop group The Roots, Questlove expresses his disappointment in his memoir Mo Meta Blues that hip-hop was going in the gangsta rap direction, for example. Gangsta rap brought into hip-hop an ideology of authenticity - the 'realness' of the rapping became a distinguishing feature by which listeners would judge the music - where previously, it had been judged by things like the beats, the storytelling, and by the flow of the rap.
The violent deaths of Biggie Smalls and Tupac Shakur underscored this ideology of realness in a headline-news kind of way - that they were demonstrably interacting with black gang culture (in that it caused their deaths) brought a lot of prominence to the style of music, by virtue of making Biggie and 2pac much more prominent in the charts, worldwide, than they previously had been (which was already reasonably prominent). Though a lot of the specific examples I'd ideally discuss here are from after 1997, and fall foul of the 20 year rule, record companies increasingly aimed to sign people who could credibly claim to be representatives of 'the streets'. And if they continued to participate in that culture (or get caught up in that culture as a result of the attention paid to their music), with its attendant dangers...hey, we didn't realise they were actually real, said the record companies.