There have also been cases where a customer violated Amazon's terms of service and lost access to all of their Kindle e-books. Amazon has all the power in this relationship. They can and do change the rules on us lowly peasants from time to time.
Note, there are indeed ways to download your books and import them into something like Calibre (and remove the DRM from the books). If you do some web searches (and/or search YouTube) you can probably figure it out.
Any of the third party reading apps and any epub file you store yourself. So if you buy an ebook from Amazon but get the epub version instead of Kindle then it's protected from deletion. This is because you store it like any other document and your epub reader just reads the file.