Linking compaction dynamics to the flow properties of powders