In Attach request, UE sends GUTI information. MME/HSS stores GUTI to IMSI mapping.
When UE is attaching, if MME does not have mapping to GUTI received from UE, it will request for identity from UE .ie. it will send out Identity request message and UE will respond with IMSI if identity type requested is 1
If identity type requested is 2 then UE will respond with IMEI. I am not sure in what case IMEI is requested.
In case MME has mapping, you will not see identity request going out from MME
Why this is done after security mode procedure is because if IMSI is sent in attach request it is prone to interception because message is not encrypted and this is the reason GUTI is sent by UE
Reference: 3GPP TS 24.301