Towards Understanding the Working Mechanism of Text-to-Image Diffusion Model