If someone is under performing, for whatever reason they need managing.
People get away with under performance because of poor management. Not always their immediate managers. Sometimes managers are doing their best but do t get support from above or told to leave it.
This also happens when people are in offices. Maybe not doing the 2 jobs. But definitely over looking under performances
Theres loads of tech out there, that makes it possible to monitor home working. I can see my teams on varying levels, from just seeing if they are 'green' on teams (which actually means very little) right down to their key strokes and everything inbetween. I also get a monthly, automated, report that outlines productivity, lost time etc.
I don't check the detail often. Only j cases where productivity is low for an extended period. Someone telling me they were working hard wouldn't cut it.
Companies can, if they are willing to handle this, be able to see everything and can stop this. For alot of them it's easier to turn a blind eye.
Bit honestly, my experience is the slackers at home were slackers in the office. Checking their side business, answering personal emails/messages. Or even disappearing for 40 mins to go to the loo and make a coffee 3 or 4 times a day.
The vast majority of people who worked well in the office, work well at home, in my experience. Especially the ones who donr want to go back.