The phrase is usually a humorous way of saying that one was not sitting idly, but engaged constructively in contemplation or letting one's mind wander.
We've all experienced that helpless feeling of standing by idly while someone you love is sufferingand wished that you could absorb the impact for them.
Domestic manufacturers, once the core base of support for economic nationalism, were idly contented to become managers or partners of the multinationals.