Why are posts deleted?
Posts are deleted for various reasons. They may be deleted either by community curators or by the original poster.
A question may be deleted because it is off topic for a particular community or category. That doesn't mean it's a bad question, just that it's not in the right place. For example, a question about musical instruments would likely be removed from a gardening community. Sometimes it's more subtle; a question about how to make flower pots could be considered gardening, but the community might want to keep posts more focused. Similarly, an opinion based question (What is the prettiest flower?) might not be on topic in some communities. Always check the community description and any linked help before posting to make sure your question will be welcomed!
An answer may be deleted for similar reasons; it's off-topic, not answering the question, etc.
Usually if a post is missing information or needs the author's attention it's temporarily put on hold. However, if it's detracting from the community it may be deleted instead. In these cases it's best to reach out to the community moderators and start a conversation with them about what needs to happen for the post to be restored. To do so, open a post on the community meta with your question. Remember to be respectful - it can be frustrating to have a post deleted but the moderators will do their best to help you understand how to improve it to fit.
Finally, sometimes a user will delete their own post(s). This might be due to realizing it wasn't a good fit for the site, or because they actually meant to ask or answer a different question.