What process happens when mud or silt is buried and water and air are squeezed out producing shale?

This is known broadly as lithification. It involves the processes of compaction and cementation. However in this specific question you only refer to the compaction process (the act of removing water and air or more technically reducing the void ratio or porosity),