Understanding Simplicity Bias towards Compositional Mappings via Learning Dynamics