Physical structure and interstitial flows govern microbial life in microenvironments