PPBM, or "Positive Passenger Bag Matching" in an international airline regulation that was introduced after the Pan Am 103 bombing, and basically requires that a passenger may not cause their checked baggage to fly on an aircraft they are not on, on the grounds that they would not blow up a plane if they knew they were on board and thus would be killed as well.
PPBM does NOT require that baggage must fly on the same aircraft as the passenger, just that the passenger may not be the one to cause that to happen. So for example, if your bag is accidentally not loaded onto a flight by the airline, it may travel on a later flight as the decision to do so would not have been made by the passenger.
However if a passenger fails to board a flight that they have checked luggage on, PPBM regulations require that either the passenger is found and boards the flight, or their luggage is removed. This removal of luggage can be a long process depending on where it is loaded on the aircraft, and may potentially require unloading other luggage or cargo in order to find the bag(s). As a result, it's almost guaranteed that having to do this will cause the flight to be delayed, and in doing so inconvenience all of the other passengers, and potentially cost the airline money.
PPBM is required for all international flights. Domestic rules will depend on the country involved, but for example the US does NOT enforce PPBM on domestic flights due to the fact that ALL passenger bags are checked for explosives using X-rays and other techniques. The rules in other countries will vary.
So to answer your specific questions - what happens to the luggage? It will be unloaded and retained by the airline. You would need to work with the airline to reclaim it or make other plans (such as being booked onto a later flight, in which case the luggage would be moved to that flight). If your travel included domestic flights (either only domestic, or domestic before your international flight) then your bag would potentially travel to the (domestic) destination - at which point it would be up to the airline to decide what to do but likely would involve you having to pay to transport it back to you.
What happens to you? In a general sense, nothing. If missing the flight was deliberate you will almost certainly lose the value of your ticket. If it was accidental the airline may assist in moving you to a later flight, although in many cases they have no obligation to do so. Nothing here is "illegal" as such, and I would not expect any legal implications in general, however that could vary significantly depending on the country involved and the exact reason for you not taking the flight.
What would happen to the other passengers on the plane? You didn't ask this one, but the answer is that they will almost certainly be delayed as a result of your actions. Depending on the length of the delay, this could cause them to miss connecting flights or other appointments.
In short, don't do this. If it happens accidentally (eg, you fall asleep in the airport and miss you flight) then so be it - but doing anything like this deliberately would be a poor move on your behalf.
Note that if you are travelling with someone else (presuming you are both on the same booking) and one of you boards, then there are a few added complications. Firstly, once they realize that your companion has boarded but you have not, they will question that person as to where you are. It is unlikely that they will remove that person from the flight, but it's possible.
Presuming you check-in together (or possibly even if you don't) it's possible that the baggage will end up being checked under the other passengers name, or their baggage being checked under your name. Thus it's possible that their bags will be removed, but that yours will fly (or some other random combination).
If the situation ever did occur where you needed to remove yourself from the flight after check-in, the only right option is to go to the airline IMMEDIATELY and let them know. This will give them additional time to find your bag (preferably before it's even placed on the aircraft), will likely avoid delaying the flight, and will make everyones life - including yours - much easier.