Some previous posts on here may be misunderstanding what happened. A bill isn't just introduced then voted on by the whole body. It first goes through at least one committee, which is usually around a dozen members of that chamber. Gun bills always go through something like the Justice committee. If there is a financial element, e.g., increasing fees for PPP, then it would also go through the Finance committee. Each committee chair has the ability to put it in a drawer and never act on it. They can introduce amendments or strike out whole sections. They can even completely rewrite the bill and vote on the "Proposed Committee Substitute". This happened at least once for each of the three good gun bills that the R's have passed since 2011. Today's vote in Virginia was not the whole chamber, just the committee of about 15.
Committee assignments are awarded by the person leading that body. If someone campaigns on say, prison reform or agriculture interests, he'd probably jockey to be on the appropriate committee where he would have more influence. Usually, party representation on each committee is proportionate to the larger body; if Democrats have 60% of the larger body, then they will have 60% of the seats on every committee. The chairman of each committee is from the majority party.
So you can see why it's important to have the majority. With gun control, you'll almost always get near 100% Democrat support, and a few Republicans can sometimes be bought. But if the chamber leadership and committee chairs don't want it, it doesn't even get voted on. Imagine you're a Republican in a district that's been going more Democrat in recent years. There's a red flag bill that you oppose but you're going to pay at election time if you vote against it. The committee chair can throw the bill in a drawer, and your opponent can't make a commercial saying you voted against "common sense gun safety".
Part of the strategy in Virginia today was to kill the AWB for this session, without having to put the whole chamber on record as voting for it. The vulnerable rural D's can keep their seats. The districts will be redrawn after this year's census, and the D's will be in control of where the lines go. They can gerrymander so that they will pick up a few more seats next election. Then they will try again for the AWB, only this time, they can afford to let the vulnerable D's vote against it, yet still have the votes to pass it.