I think this highly depends on the manager. Some know (Manager A), and either work to correct it, or get their ducks in a row to fire them. Plenty of managers, though, (Manager B) have no idea what a reasonable amount of work output is, and can be easily convinced that what took 1-2 hours to do constituted an entire 40 hour week. You get some developer who's good at "managing upward" and they'll bullshit/charm and walk all over that manager. Often these managers are themselves "managing upward" to their directors, and so on up the chain, resulting in an entire reporting line successfully doing nothing.
It doesn't matter that the slacker's peers know exactly what is going on. They're too busy doing their own work, and if they complain about it to Manager B, they won't be believed.