It is both. Speed limits work because majority of the people respect them. Cops can’t control the entire population, if majority choose to misbehave. This is what it feels like online. People seem to relish in posting other’s misfortune, mistakes etc with little consequences. They do things online that they wouldn’t dare to do in real life.
If the attitude doesn’t change, no amount of laws would help