Minecraft wiki entry for Development_versions, associated text: All containers output a redstone signal when a comparator is placed against it directly.
The strength of it depends on how full the container is.[2]
This works with trapped chests as well, meaning it can provide two redstone signals with different causes at the same time.