If you are working from home, you are judged solely by your productivity. If you work in an office, there is productivity and there is also attendance. Someone can show up every day and appear to be working hard, yet get nothing done. You just can't do that working from home (not for very long anyways).
For most professionals, attendance shouldn't really matter. You're not creating value by merely being present. There are exceptions - customer service for example - but even in those cases being just logged into Slack/Teams is perfectly cromulent.