Hello Sushant,
This was experienced by me as well as by the end-users many times. I use to call BASIS, who immediately identifies the locked session and releases. I did not try to know the Tcode with which they do it. (Only BASIS is authorized for this). Secondly, Logging out and Logging in again does not help here.
About the 'why' you asked, It is purely SAP technical thing, can be a memory related issue where end-user has absolutely no role. Again only BASIS people will be able to explain in technical terms.
KJogeswaraRao