This isn't correct. All nonessential work stops immediately regardless of funding and all essential work continues. Individual workers don't choose whether they work or not, their departments do. Historically, everyone gets their backpay when the shutdown ends, essential or not, based on their salary level.
The source of funding matters. There are parts of the Federal government that are not entirely funded by annual appropriations from Congress. Funding from permanent appropriations or fee collection has not stopped, and agencies are allowed to operate to the extent that those other, non-lapsed funding sources can support. For example, a National Park campground that can support a basic level of services with the fees it collects doesn't have to shut down.
And after the 2018-2019 shutdown, a law was passed guaranteeing backpay. But the WH has gone back and forth on whether that very plainly written law would apply to this lapse in appropriations even though the law very clearly does apply to it. I believe today they are back to paying furloughed employees.