Deep learning insights into cosmological structure formation