Imagine I have put some protected by DRM ebooks into a computer; imagine this computer becomes old or breaks, so that I have to change it, but I have forgot the chosen ID; how can I read these ebooks in the new computer?
It probably would help to know which company's DRM you are talking about.
First, with Adobe ID, there are ways to retrieve the password or even the ID if you have the correct email associated with the account.
In some cases (not often, thankfully), the ebook distributor might allow you to download an ebook only once and not let you download it again. In that case you are out of luck.
In other cases, the ebook distributor is out of business, so you cannot retrieve the password or login.
This is one advantage of choosing a DRM-free distributor like smashwords (instead of apple, Adobe, Kindle). You can keep backups -- and as long as it's a well-known format, you can read it in other reading systems.
On the other hand, distributors with DRM try to keep the ebooks available in the cloud so you you can read it in on different reading systems. This of course assumes that the distributor makes reading apps for different operating systems (as do Google and Kindle, but not Apple, for example).
It's possible that there are ways to break the DRM, but discussions about these things are not appropriate here (and it may be illegal in your country).