Questions are deleted when they:
are not currently adding value to the site; typically in the form of a good answer that was posted before the question was closed.
cannot be improved to be on topic; the question is unsalvagable. That, or the question is unlikely to ever be salvaged (the author was given ample opportunity to improve the post and it has been long enough that they are clearly not going to).
There are both automated and manual processes for this. When a Q/A meets certain criteria that indicates it is both not useful and unlikely to be improved, it's deleted.
Questions can also be deleted by a moderator at any time, or by 3 10k+ community members (if the post is at least 2 days old or has a score less than -3 by 20k+), if they feel that the above criteria apply.