It's important to distinguish between question and answer posts on one hand, and comments on the other. Q&A posts are the primary content on Mi Yodeya, while comments are "temporary 'Post-It' notes left on a question or answer."
Q&A Posts
Question and answer posts get deleted relatively infrequently. Descriptions of how and why they can get deleted are in the pair of FAQ posts mbloch shared in his answer:
Generally speaking, there are two categories of reasons why we would delete a Q&A post:
The post does not do at all what that kind of post is supposed to do, i.e. question posts that don't pose a question at all relevant to this community, or answer posts that don't respond at all to the question at hand.
The content of the post abuses the community in some egregious way.
Besides the relatively high bar for deletion, the site privileges Q&A posts in another important way: posts deleted by the community can always be seen by their authors and some community members, can be improved by the people who can see them, and can always be undeleted. For example, you can see lists of every single question and answer you've posted, including deleted ones, here and here. The deleted posts are highlighted in pink. At present, you have two deleted answers, one of which you deleted and one of which was converted to a comment by a moderator.
Comments
Comments are secondary to Q&A posts. They are meant to be temporary aids to improving whatever they're posted on. As such, they may be deleted at any time if they are not directed towards that purpose or if they have already served that purpose. They can also be deleted if they are abusive in any way or are inconsistent in any way with our Code of Conduct. Secondary as they are, it's often not worth keeping comments around that are destructive to the community.
Moderators can view, edit, and undelete deleted comments. If you believe an comment of yours was deleted incorrectly or prematurely, you can appeal that action directly to the moderators by flagging the post it was on "for moderator attention," or you can bring it up here on Meta or in Chat.